Skip to content

Commit

Permalink
Move session support check into server selection for unified topology
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Feb 17, 2021
1 parent 7909c78 commit 60c0b22
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/operations/execute_operation.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ function executeWithServerSelection(topology, operation, callback) {
return;
}

if (serverSelectionOptions.session && topology.hasSessionSupport()) {
return callback(new MongoError('Current topology does not support sessions'));
}

const shouldRetryReads =
topology.s.options.retryReads !== false &&
operation.session &&
Expand Down

0 comments on commit 60c0b22

Please sign in to comment.