File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,14 @@ export abstract class CommandOperation<
73
73
: new MongoDBNamespace ( 'admin' , '$cmd' ) ;
74
74
}
75
75
76
- const readPref = ReadPreference . fromOptions ( options ) ;
77
- this . readPreference =
78
- this . hasAspect ( Aspect . WRITE_OPERATION ) || readPref === undefined
79
- ? ReadPreference . primary
80
- : readPref ;
76
+ const readPref = ReadPreference . fromOptions ( options ) ?? ReadPreference . primary ;
77
+ this . readPreference = this . hasAspect ( Aspect . WRITE_OPERATION )
78
+ ? ReadPreference . primary
79
+ : readPref ;
81
80
this . readConcern = ReadConcern . fromOptions ( options ) ;
82
81
this . writeConcern = WriteConcern . fromOptions ( options ) ;
83
82
this . bsonOptions = resolveBSONOptions ( options ) ;
83
+
84
84
this . explain = false ;
85
85
this . fullResponse =
86
86
options && typeof options . fullResponse === 'boolean' ? options . fullResponse : false ;
You can’t perform that action at this time.
0 commit comments