Skip to content

Commit

Permalink
feat(parallelCollectionScan): does not allow user to pass a session
Browse files Browse the repository at this point in the history
Sessions are not valid options for a `parallelCollectionScan`. We already did not do implicit sessions, but we still documented session as a valid option, and did not stop a user from passing in an explicit session.

Fixes NODE-1490
  • Loading branch information
daprahamian committed Jun 8, 2018
1 parent 87fccee commit c699603
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/collection.js
Expand Up @@ -2499,7 +2499,6 @@ Collection.prototype.watch = function(pipeline, options) {
* @param {number} [options.batchSize=null] Set the batchSize for the getMoreCommand when iterating over the query results.
* @param {number} [options.numCursors=1] The maximum number of parallel command cursors to return (the number of returned cursors will be in the range 1:numCursors)
* @param {boolean} [options.raw=false] Return all BSON documents as Raw Buffer documents.
* @param {ClientSession} [options.session] optional session to use for this operation
* @param {Collection~parallelCollectionScanCallback} [callback] The command result callback
* @return {Promise} returns Promise if no callback passed
*/
Expand All @@ -2516,6 +2515,10 @@ Collection.prototype.parallelCollectionScan = function(options, callback) {
// Add a promiseLibrary
options.promiseLibrary = this.s.promiseLibrary;

if (options.session) {
options.session = undefined;
}

return executeOperation(this.s.topology, parallelCollectionScan, [this, options, callback], {
skipSessions: true
});
Expand Down

0 comments on commit c699603

Please sign in to comment.