Skip to content

Commit e855c83

Browse files
committed
fix: pass options into commandSupportsReadConcern
1 parent a110ee4 commit e855c83

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/core/sessions.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,12 @@ function commandSupportsReadConcern(command, options) {
661661
return true;
662662
}
663663

664-
if (command.mapReduce && options.out && (options.out.inline === 1 || options.out === 'inline')) {
664+
if (
665+
command.mapReduce &&
666+
options &&
667+
options.out &&
668+
(options.out.inline === 1 || options.out === 'inline')
669+
) {
665670
return true;
666671
}
667672

@@ -692,7 +697,7 @@ function applySession(session, command, options) {
692697
// first apply non-transaction-specific sessions data
693698
const inTransaction = session.inTransaction() || isTransactionCommand(command);
694699
const isRetryableWrite = options.willRetryWrite;
695-
const shouldApplyReadConcern = commandSupportsReadConcern(command);
700+
const shouldApplyReadConcern = commandSupportsReadConcern(command, options);
696701

697702
if (serverSession.txnNumber && (isRetryableWrite || inTransaction)) {
698703
command.txnNumber = BSON.Long.fromNumber(serverSession.txnNumber);

0 commit comments

Comments
 (0)