From 317055bb1ba17b9a752349bf264b1b9709fc481d Mon Sep 17 00:00:00 2001 From: Dan Aprahamian Date: Thu, 13 Jun 2019 15:48:51 -0400 Subject: [PATCH] fix(cursor): do not truncate an existing Long Port of mongodb-js/mongodb-core#441 to native. --- lib/core/cursor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/cursor.js b/lib/core/cursor.js index efeaa7b983..66f6639896 100644 --- a/lib/core/cursor.js +++ b/lib/core/cursor.js @@ -683,7 +683,7 @@ function initializeCursor(cursor, callback) { // Otherwise fall back to regular find path const cursorId = result.cursorId || 0; - cursor.cursorState.cursorId = Long.fromNumber(cursorId); + cursor.cursorState.cursorId = cursorId instanceof Long ? cursorId : Long.fromNumber(cursorId); cursor.cursorState.documents = result.documents; cursor.cursorState.lastCursorId = result.cursorId;