mongo/jstests/replsets/single_server_majority.js
Steve McClure 1ffbc6c2e9 SERVER-109432: Autofix JS var usage to favor let (#40637)
GitOrigin-RevId: 9674b7db36a0f3f650d39c1e3fb2ad6ff2141cfb
2025-08-28 19:21:01 +00:00

14 lines
470 B
JavaScript

// This test checks that w:"majority" works correctly on a lone mongod
// set up a mongod and connect
let mongod = MongoRunner.runMongod({});
// get db and collection, then perform a trivial insert
const db = mongod.getDB("test");
let col = db.getCollection("single_server_majority");
col.drop();
// see if we can get a majority write on this single server
assert.commandWorked(col.save({a: "test"}, {writeConcern: {w: "majority"}}));
MongoRunner.stopMongod(mongod);