Files
mongo/jstests/replsets/single_server_majority.js
2015-09-25 17:30:33 -04:00

12 lines
425 B
JavaScript

// 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")
col = db.getCollection("single_server_majority");
col.drop();
// see if we can get a majority write on this single server
assert.writeOK(col.save({ a: "test" }, { writeConcern: { w: 'majority' }}));