Problem Statement/Rationale
The createIndexes() helper ignores the options passed to the third positional argument, which as documented as being the commitQuorum:
db.collection.createIndexes( [ keyPatterns ], options, commitQuorum )
Steps to Reproduce
Start a 1-node replica set and create an index with the commitQuorum as "3":
rs [direct: primary] test> db.test.createIndexes([{a: 1}], {}, 3) [ 'a_1' ]
Expected Results
Using the legacy shell:
rs:PRIMARY> db.test.createIndexes([{a: 1}], {}, 3) { "ok" : 0, "errmsg" : "Not enough data-bearing voting nodes to satisfy commit quorum", "code" : 278, "codeName" : "UnsatisfiableCommitQuorum", "$clusterTime" : { "clusterTime" : Timestamp(1644506422, 1), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } }, "operationTime" : Timestamp(1644506422, 1) }
Actual Results
The shell appears to be discarding the provided commitQuorum and using the default.
Additional Notes
None