diff --git a/lib/core/wireprotocol/get_more.js b/lib/core/wireprotocol/get_more.js index ec9cd6abe4..b2db320265 100644 --- a/lib/core/wireprotocol/get_more.js +++ b/lib/core/wireprotocol/get_more.js @@ -80,6 +80,10 @@ function getMore(server, ns, cursorState, batchSize, options, callback) { options ); + if (cursorState.session) { + commandOptions.session = cursorState.session; + } + command(server, ns, getMoreCmd, commandOptions, queryCallback); } diff --git a/lib/core/wireprotocol/query.js b/lib/core/wireprotocol/query.js index 0a45af2154..c501b50644 100644 --- a/lib/core/wireprotocol/query.js +++ b/lib/core/wireprotocol/query.js @@ -46,7 +46,14 @@ function query(server, ns, cmd, cursorState, options, callback) { options ); - if (cmd.readPreference) commandOptions.readPreference = readPreference; + if (cmd.readPreference) { + commandOptions.readPreference = readPreference; + } + + if (cursorState.session) { + commandOptions.session = cursorState.session; + } + command(server, ns, findCmd, commandOptions, callback); }