0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/replsets/single_server_majority.js

14 lines
497 B
JavaScript
Raw Normal View History

// This test checks that w:"majority" works correctly on a lone mongod
// set up a mongod and connect a mongo
var mongod = MongoRunner.runMongod({});
var mongo = startMongoProgram("mongo", "--port", mongod.port);
// get db and collection, then preform a trivial insert
db = mongo.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' }}));