Skip to content

Commit

Permalink
fix: pass options into commandSupportsReadConcern
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Feb 11, 2020
1 parent a110ee4 commit e855c83
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/core/sessions.js
Expand Up @@ -661,7 +661,12 @@ function commandSupportsReadConcern(command, options) {
return true;
}

if (command.mapReduce && options.out && (options.out.inline === 1 || options.out === 'inline')) {
if (
command.mapReduce &&
options &&
options.out &&
(options.out.inline === 1 || options.out === 'inline')
) {
return true;
}

Expand Down Expand Up @@ -692,7 +697,7 @@ function applySession(session, command, options) {
// first apply non-transaction-specific sessions data
const inTransaction = session.inTransaction() || isTransactionCommand(command);
const isRetryableWrite = options.willRetryWrite;
const shouldApplyReadConcern = commandSupportsReadConcern(command);
const shouldApplyReadConcern = commandSupportsReadConcern(command, options);

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

0 comments on commit e855c83

Please sign in to comment.