From cb5df28fb21ec52690964c2f9ecf3b2ad217145d Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Wed, 20 Jun 2018 14:36:03 -0400 Subject: [PATCH] fix(cursor): check for sessions independently in core cursor --- lib/cursor.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cursor.js b/lib/cursor.js index 8a08f1cf5..1cfe86cb6 100644 --- a/lib/cursor.js +++ b/lib/cursor.js @@ -107,13 +107,15 @@ var Cursor = function(bson, ns, cmd, options, topology, topologyOptions) { transforms: options.transforms }; + if (typeof options.session === 'object') { + this.cursorState.session = options.session; + } + // Add promoteLong to cursor state if (typeof topologyOptions.promoteLongs === 'boolean') { this.cursorState.promoteLongs = topologyOptions.promoteLongs; } else if (typeof options.promoteLongs === 'boolean') { this.cursorState.promoteLongs = options.promoteLongs; - } else if (typeof options.session === 'object') { - this.cursorState.session = options.session; } // Add promoteValues to cursor state