Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit cb5df28

Browse files
committed
fix(cursor): check for sessions independently in core cursor
1 parent 48c5beb commit cb5df28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/cursor.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ var Cursor = function(bson, ns, cmd, options, topology, topologyOptions) {
107107
transforms: options.transforms
108108
};
109109

110+
if (typeof options.session === 'object') {
111+
this.cursorState.session = options.session;
112+
}
113+
110114
// Add promoteLong to cursor state
111115
if (typeof topologyOptions.promoteLongs === 'boolean') {
112116
this.cursorState.promoteLongs = topologyOptions.promoteLongs;
113117
} else if (typeof options.promoteLongs === 'boolean') {
114118
this.cursorState.promoteLongs = options.promoteLongs;
115-
} else if (typeof options.session === 'object') {
116-
this.cursorState.session = options.session;
117119
}
118120

119121
// Add promoteValues to cursor state

0 commit comments

Comments
 (0)