Files
mongo/jstests/multiVersion/genericSetFCVUsage/bit_update_mixed_fcv.js
2023-08-06 20:48:04 +00:00

25 lines
654 B
JavaScript

/**
* Tests that $bit updates succeed if primaries compare updates numerically and secondaries compare
* updates lexicographically for array indexes.
*/
const rst = new ReplSetTest({
nodes: 2,
nodeOptions: {binVersion: "latest"},
});
rst.startSet();
rst.initiate();
const primary = rst.getPrimary();
const testDB = primary.getDB(jsTestName());
const coll = testDB.test;
testDB.adminCommand({setFeatureCompatibilityVersion: lastLTSFCV, confirm: true});
assert.commandWorked(coll.insert({_id: 0, arr: [0]}));
assert.commandWorked(
coll.update({_id: 0}, {$bit: {"a.9": {or: NumberInt(0)}, "a.10": {or: NumberInt(0)}}}));
rst.stopSet();