Skip to content

Commit a582042

Browse files
mbroadstdaprahamian
authored andcommitted
refactor(command): use constant for writeConcer/collation support
1 parent ab60957 commit a582042

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/operations/command_v2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ const WriteConcern = require('../write_concern');
88
const maxWireVersion = require('../core/utils').maxWireVersion;
99
const commandSupportsReadConcern = require('../core/sessions').commandSupportsReadConcern;
1010

11+
const SUPPORTS_WRITE_CONCERN_AND_COLLATION = 5;
12+
1113
class CommandOperationV2 extends OperationBase {
1214
constructor(parent, options) {
1315
super(options);
@@ -42,7 +44,7 @@ class CommandOperationV2 extends OperationBase {
4244
Object.assign(cmd, { readConcern: this.readConcern });
4345
}
4446

45-
if (serverWireVersion >= 5) {
47+
if (serverWireVersion >= SUPPORTS_WRITE_CONCERN_AND_COLLATION) {
4648
if (this.writeConcern && this.hasAspect(Aspect.WRITE_OPERATION)) {
4749
Object.assign(cmd, { writeConcern: this.writeConcern });
4850
}

0 commit comments

Comments
 (0)