File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -736,5 +736,6 @@ module.exports = {
736
736
ServerSessionPool,
737
737
TxnState,
738
738
applySession,
739
- updateSessionFromResponse
739
+ updateSessionFromResponse,
740
+ commandSupportsReadConcern
740
741
} ;
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const resolveReadPreference = require('../utils').resolveReadPreference;
6
6
const ReadConcern = require ( '../read_concern' ) ;
7
7
const WriteConcern = require ( '../write_concern' ) ;
8
8
const maxWireVersion = require ( '../core/utils' ) . maxWireVersion ;
9
+ const commandSupportsReadConcern = require ( '../core/sessions' ) . commandSupportsReadConcern ;
9
10
10
11
class CommandOperationV2 extends OperationBase {
11
12
constructor ( parent , options ) {
@@ -37,7 +38,7 @@ class CommandOperationV2 extends OperationBase {
37
38
const serverWireVersion = maxWireVersion ( server ) ;
38
39
const inTransaction = this . session && this . session . inTransaction ( ) ;
39
40
40
- if ( this . readConcern && this . hasAspect ( Aspect . READ_OPERATION ) && ! inTransaction ) {
41
+ if ( this . readConcern && commandSupportsReadConcern ( cmd ) && ! inTransaction ) {
41
42
Object . assign ( cmd , { readConcern : this . readConcern } ) ;
42
43
}
43
44
You can’t perform that action at this time.
0 commit comments