summaryrefslogtreecommitdiff
path: root/jstests/sharding/multi_write_target.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/multi_write_target.js')
-rw-r--r--jstests/sharding/multi_write_target.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/jstests/sharding/multi_write_target.js b/jstests/sharding/multi_write_target.js
index 90330f43cc0..14d1e0d6a39 100644
--- a/jstests/sharding/multi_write_target.js
+++ b/jstests/sharding/multi_write_target.js
@@ -23,13 +23,13 @@ assert.commandWorked(
jsTest.log("Testing multi-update...");
// Put data on all shards
-assert.writeOK(st.s0.getCollection(coll.toString()).insert({_id: 0, skey: -1, x: 1}));
-assert.writeOK(st.s0.getCollection(coll.toString()).insert({_id: 1, skey: 1, x: 1}));
-assert.writeOK(st.s0.getCollection(coll.toString()).insert({_id: 0, skey: 100, x: 1}));
+assert.commandWorked(st.s0.getCollection(coll.toString()).insert({_id: 0, skey: -1, x: 1}));
+assert.commandWorked(st.s0.getCollection(coll.toString()).insert({_id: 1, skey: 1, x: 1}));
+assert.commandWorked(st.s0.getCollection(coll.toString()).insert({_id: 0, skey: 100, x: 1}));
// Non-multi-update doesn't work without shard key
assert.writeError(coll.update({x: 1}, {$set: {updated: true}}, {multi: false}));
-assert.writeOK(coll.update({x: 1}, {$set: {updated: true}}, {multi: true}));
+assert.commandWorked(coll.update({x: 1}, {$set: {updated: true}}, {multi: true}));
// Ensure update goes to *all* shards
assert.neq(null, st.shard0.getCollection(coll.toString()).findOne({updated: true}));
@@ -38,7 +38,7 @@ assert.neq(null, st.shard2.getCollection(coll.toString()).findOne({updated: true
// _id update works, and goes to all shards even on the stale mongos
var staleColl = st.s1.getCollection('foo.bar');
-assert.writeOK(staleColl.update({_id: 0}, {$set: {updatedById: true}}, {multi: false}));
+assert.commandWorked(staleColl.update({_id: 0}, {$set: {updatedById: true}}, {multi: false}));
// Ensure _id update goes to *all* shards
assert.neq(null, st.shard0.getCollection(coll.toString()).findOne({updatedById: true}));
@@ -49,7 +49,7 @@ jsTest.log("Testing multi-delete...");
// non-multi-delete doesn't work without shard key
assert.writeError(coll.remove({x: 1}, {justOne: true}));
-assert.writeOK(coll.remove({x: 1}, {justOne: false}));
+assert.commandWorked(coll.remove({x: 1}, {justOne: false}));
// Ensure delete goes to *all* shards
assert.eq(null, st.shard0.getCollection(coll.toString()).findOne({x: 1}));
@@ -57,12 +57,12 @@ assert.eq(null, st.shard1.getCollection(coll.toString()).findOne({x: 1}));
assert.eq(null, st.shard2.getCollection(coll.toString()).findOne({x: 1}));
// Put more on all shards
-assert.writeOK(st.shard0.getCollection(coll.toString()).insert({_id: 0, skey: -1, x: 1}));
-assert.writeOK(st.shard1.getCollection(coll.toString()).insert({_id: 1, skey: 1, x: 1}));
+assert.commandWorked(st.shard0.getCollection(coll.toString()).insert({_id: 0, skey: -1, x: 1}));
+assert.commandWorked(st.shard1.getCollection(coll.toString()).insert({_id: 1, skey: 1, x: 1}));
// Data not in chunks
-assert.writeOK(st.shard2.getCollection(coll.toString()).insert({_id: 0, x: 1}));
+assert.commandWorked(st.shard2.getCollection(coll.toString()).insert({_id: 0, x: 1}));
-assert.writeOK(coll.remove({_id: 0}, {justOne: true}));
+assert.commandWorked(coll.remove({_id: 0}, {justOne: true}));
// Ensure _id delete goes to *all* shards
assert.eq(null, st.shard0.getCollection(coll.toString()).findOne({x: 1}));