2013-05-20 16:37:26 +02:00
|
|
|
// This test checks that w:"majority" works correctly on a lone mongod
|
|
|
|
|
|
|
|
// set up a mongod and connect a mongo
|
2015-03-22 17:08:21 +01:00
|
|
|
var mongod = MongoRunner.runMongod({});
|
|
|
|
var mongo = startMongoProgram("mongo", "--port", mongod.port);
|
2013-05-20 16:37:26 +02:00
|
|
|
|
|
|
|
// 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
|
2014-03-03 17:27:18 +01:00
|
|
|
assert.writeOK(col.save({ a: "test" }, { writeConcern: { w: 'majority' }}));
|
|
|
|
|