Skip to content

Commit 4da9e03

Browse files
authored
feat(parallelCollectionScan): does not allow user to pass a session
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
1 parent 184b817 commit 4da9e03

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/collection.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2501,7 +2501,6 @@ Collection.prototype.watch = function(pipeline, options) {
25012501
* @param {number} [options.batchSize=null] Set the batchSize for the getMoreCommand when iterating over the query results.
25022502
* @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)
25032503
* @param {boolean} [options.raw=false] Return all BSON documents as Raw Buffer documents.
2504-
* @param {ClientSession} [options.session] optional session to use for this operation
25052504
* @param {Collection~parallelCollectionScanCallback} [callback] The command result callback
25062505
* @return {Promise} returns Promise if no callback passed
25072506
*/
@@ -2518,6 +2517,10 @@ Collection.prototype.parallelCollectionScan = function(options, callback) {
25182517
// Add a promiseLibrary
25192518
options.promiseLibrary = this.s.promiseLibrary;
25202519

2520+
if (options.session) {
2521+
options.session = undefined;
2522+
}
2523+
25212524
return executeOperation(this.s.topology, parallelCollectionScan, [this, options, callback], {
25222525
skipSessions: true
25232526
});

0 commit comments

Comments
 (0)