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 authored Jun 8, 2018
1 parent 184b817 commit 4da9e03
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -2501,7 +2501,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 @@ -2518,6 +2517,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 4da9e03

Please sign in to comment.