2013-05-20 10:37:26 -04:00
|
|
|
// This test checks that w:"majority" works correctly on a lone mongod
|
|
|
|
|
|
2015-09-22 11:40:43 -04:00
|
|
|
// set up a mongod and connect
|
2015-03-22 12:08:21 -04:00
|
|
|
var mongod = MongoRunner.runMongod({});
|
2013-05-20 10:37:26 -04:00
|
|
|
|
2015-09-23 22:36:21 -04:00
|
|
|
// get db and collection, then perform a trivial insert
|
2015-09-22 11:40:43 -04:00
|
|
|
db = mongod.getDB("test")
|
2013-05-20 10:37:26 -04:00
|
|
|
col = db.getCollection("single_server_majority");
|
|
|
|
|
col.drop();
|
2014-03-03 11:27:18 -05:00
|
|
|
|
2015-09-23 22:36:21 -04:00
|
|
|
// see if we can get a majority write on this single server
|
|
|
|
|
assert.writeOK(col.save({ a: "test" }, { writeConcern: { w: 'majority' }}));
|