Files
mongo/jstests/multiVersion/genericSetFCVUsage/bit_update_mixed_fcv.js
Zac 591928c619 SERVER-108478 JS formatted by prettier and remove clang-format (#39656)
GitOrigin-RevId: 6c8f6aded47f260aa4f7c231b17dae3302cb1e04
2025-08-21 17:27:09 +00:00

27 lines
708 B
JavaScript

/**
* Tests that $bit updates succeed if primaries compare updates numerically and secondaries compare
* updates lexicographically for array indexes.
*/
import {ReplSetTest} from "jstests/libs/replsettest.js";
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();