Skip to content

Commit 317055b

Browse files
committed
fix(cursor): do not truncate an existing Long
Port of mongodb-js/mongodb-core#441 to native.
1 parent 659d2cc commit 317055b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/core/cursor.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ function initializeCursor(cursor, callback) {
683683

684684
// Otherwise fall back to regular find path
685685
const cursorId = result.cursorId || 0;
686-
cursor.cursorState.cursorId = Long.fromNumber(cursorId);
686+
cursor.cursorState.cursorId = cursorId instanceof Long ? cursorId : Long.fromNumber(cursorId);
687687
cursor.cursorState.documents = result.documents;
688688
cursor.cursorState.lastCursorId = result.cursorId;
689689

0 commit comments

Comments
 (0)