Skip to content

Commit 904af17

Browse files
committed
Move session support check into server selection for unified topology
1 parent 4b2021a commit 904af17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/operations/execute_operation.js

+4
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ function executeWithServerSelection(topology, operation, callback) {
142142
return;
143143
}
144144

145+
if (serverSelectionOptions.session && topology.hasSessionSupport()) {
146+
return callback(new MongoError('Current topology does not support sessions'));
147+
}
148+
145149
const shouldRetryReads =
146150
topology.s.options.retryReads !== false &&
147151
operation.session &&

0 commit comments

Comments
 (0)