blob: fab4969d8e42baa51467aac93a04a8b6187104d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// This test checks that w:"majority" works correctly on a lone mongod
// set up a mongod and connect
var mongod = MongoRunner.runMongod({});
// get db and collection, then perform a trivial insert
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);
|