summaryrefslogtreecommitdiff
path: root/jstests/sharding/update_immutable_fields.js
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@mongodb.com>2019-08-14 13:52:59 +0000
committerevergreen <evergreen@mongodb.com>2019-08-14 13:52:59 +0000
commit39c3a5d77b976e131d37476f2e7255d6058f5093 (patch)
tree01cc28719f215b17196ec913f475cd8efda9b37d /jstests/sharding/update_immutable_fields.js
parent69d0dd1dc4fb1f78d21c47aa5dd82aa9077b69eb (diff)
downloadmongo-39c3a5d77b976e131d37476f2e7255d6058f5093.tar.gz
SERVER-42773 Replace uses of the assert.writeOK() Javascript assertion with assert.commandWorked()
Diffstat (limited to 'jstests/sharding/update_immutable_fields.js')
-rw-r--r--jstests/sharding/update_immutable_fields.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/jstests/sharding/update_immutable_fields.js b/jstests/sharding/update_immutable_fields.js
index 96bf4f454dc..73c3d460403 100644
--- a/jstests/sharding/update_immutable_fields.js
+++ b/jstests/sharding/update_immutable_fields.js
@@ -43,18 +43,18 @@ shard0Coll.remove({});
assert.writeError(shard0Coll.save({_id: 3}));
// Full shard key in save
-assert.writeOK(shard0Coll.save({_id: 1, a: 1}));
+assert.commandWorked(shard0Coll.save({_id: 1, a: 1}));
// Full shard key on replacement (basically the same as above)
shard0Coll.remove({});
-assert.writeOK(shard0Coll.update({_id: 1}, {a: 1}, true));
+assert.commandWorked(shard0Coll.update({_id: 1}, {a: 1}, true));
// Full shard key after $set
shard0Coll.remove({});
-assert.writeOK(shard0Coll.update({_id: 1}, {$set: {a: 1}}, true));
+assert.commandWorked(shard0Coll.update({_id: 1}, {$set: {a: 1}}, true));
// Update existing doc (replacement), same shard key value
-assert.writeOK(shard0Coll.update({_id: 1}, {a: 1}));
+assert.commandWorked(shard0Coll.update({_id: 1}, {a: 1}));
// Update existing doc ($set), same shard key value
assert.commandWorked(shard0Coll.update({_id: 1}, {$set: {a: 1}}));
@@ -74,7 +74,7 @@ assert.writeError(shard0Coll.update({_id: 1}, {$unset: {a: 1}}));
// Error due to removing all the embedded fields.
shard0Coll.remove({});
-assert.writeOK(shard0Coll.save({_id: 2, a: {c: 1, b: 1}}));
+assert.commandWorked(shard0Coll.save({_id: 2, a: {c: 1, b: 1}}));
assert.writeError(shard0Coll.update({}, {$unset: {"a.c": 1}}));
assert.writeError(shard0Coll.update({}, {$unset: {"a.b": 1, "a.c": 1}}));