diff options
Diffstat (limited to 'jstests/core/shell_writeconcern.js')
-rw-r--r-- | jstests/core/shell_writeconcern.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/jstests/core/shell_writeconcern.js b/jstests/core/shell_writeconcern.js index 26d68304c63..ae431dab94b 100644 --- a/jstests/core/shell_writeconcern.js +++ b/jstests/core/shell_writeconcern.js @@ -33,7 +33,7 @@ assert.eq(undefined, collB.getWriteConcern()); assert.eq(undefined, db.getWriteConcern()); // test methods, by generating an error -var res = assert.writeOK(collA.save({_id: 1}, {writeConcern: {w: 1}})); +var res = assert.commandWorked(collA.save({_id: 1}, {writeConcern: {w: 1}})); if (!db.getMongo().useWriteCommands()) { assert.eq(1, res.n, tojson(res)); assert.eq(1, res.upserted, tojson(res)); @@ -41,34 +41,34 @@ if (!db.getMongo().useWriteCommands()) { assert.eq(1, res.nUpserted, tojson(res)); } -var res = assert.writeOK(collA.update({_id: 1}, {_id: 1}, {writeConcern: {w: 1}})); +var res = assert.commandWorked(collA.update({_id: 1}, {_id: 1}, {writeConcern: {w: 1}})); if (!db.getMongo().useWriteCommands()) { assert.eq(1, res.n, tojson(res)); } else { assert.eq(1, res.nMatched, tojson(res)); } -var res = assert.writeOK(collA.update({_id: 1}, {_id: 1}, {writeConcern: {w: 1}})); +var res = assert.commandWorked(collA.update({_id: 1}, {_id: 1}, {writeConcern: {w: 1}})); if (!db.getMongo().useWriteCommands()) { assert.eq(1, res.n, tojson(res)); } else { assert.eq(1, res.nMatched, tojson(res)); } -var res = assert.writeOK(collA.insert({_id: 2}, {writeConcern: {w: 1}})); +var res = assert.commandWorked(collA.insert({_id: 2}, {writeConcern: {w: 1}})); if (!db.getMongo().useWriteCommands()) { assert.eq(0, res.n, tojson(res)); } else { assert.eq(1, res.nInserted, tojson(res)); } -var res = assert.writeOK(collA.remove({_id: 3}, {writeConcern: {w: 1}})); +var res = assert.commandWorked(collA.remove({_id: 3}, {writeConcern: {w: 1}})); if (!db.getMongo().useWriteCommands()) { assert.eq(0, res.n, tojson(res)); } else { assert.eq(0, res.nRemoved, tojson(res)); } -var res = assert.writeOK(collA.remove({}, {justOne: true, writeConcern: {w: 1}})); +var res = assert.commandWorked(collA.remove({}, {justOne: true, writeConcern: {w: 1}})); if (!db.getMongo().useWriteCommands()) { assert.eq(1, res.n, tojson(res)); } else { @@ -76,7 +76,7 @@ if (!db.getMongo().useWriteCommands()) { } // Test ordered write concern, and that the write concern isn't run/error. -assert.writeOK(collA.insert({_id: 1})); +assert.commandWorked(collA.insert({_id: 1})); var res = assert.writeError(collA.insert([{_id: 1}, {_id: 1}], {ordered: true, writeConcern: {w: 1}})); |