diff options
author | James Wahlin <james.wahlin@mongodb.com> | 2019-08-14 13:52:59 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-08-14 13:52:59 +0000 |
commit | 39c3a5d77b976e131d37476f2e7255d6058f5093 (patch) | |
tree | 01cc28719f215b17196ec913f475cd8efda9b37d /jstests/core/not2.js | |
parent | 69d0dd1dc4fb1f78d21c47aa5dd82aa9077b69eb (diff) | |
download | mongo-39c3a5d77b976e131d37476f2e7255d6058f5093.tar.gz |
SERVER-42773 Replace uses of the assert.writeOK() Javascript assertion with assert.commandWorked()
Diffstat (limited to 'jstests/core/not2.js')
-rw-r--r-- | jstests/core/not2.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/jstests/core/not2.js b/jstests/core/not2.js index 8f0f91da1d5..0692c297762 100644 --- a/jstests/core/not2.js +++ b/jstests/core/not2.js @@ -20,10 +20,10 @@ function fail(query) { } function doTest() { - assert.writeOK(coll.remove({})); + assert.commandWorked(coll.remove({})); - assert.writeOK(coll.insert({i: "a"})); - assert.writeOK(coll.insert({i: "b"})); + assert.commandWorked(coll.insert({i: "a"})); + assert.commandWorked(coll.insert({i: "b"})); // TODO SERVER-12735: We currently do not handle double negatives during query // canonicalization. @@ -58,14 +58,14 @@ function doTest() { check({i: {$not: {$type: 1}}}, ["a", "b"]); check({i: {$not: {$type: 2}}}, []); - assert.writeOK(coll.remove({})); - assert.writeOK(coll.insert({i: 1})); + assert.commandWorked(coll.remove({})); + assert.commandWorked(coll.insert({i: 1})); check({i: {$not: {$mod: [5, 1]}}}, []); check({i: {$mod: [5, 2]}}, []); check({i: {$not: {$mod: [5, 2]}}}, [1]); - assert.writeOK(coll.remove({})); - assert.writeOK(coll.insert({i: ["a", "b"]})); + assert.commandWorked(coll.remove({})); + assert.commandWorked(coll.insert({i: ["a", "b"]})); check({i: {$not: {$size: 2}}}, []); check({i: {$not: {$size: 3}}}, [["a", "b"]]); check({i: {$not: {$gt: "a"}}}, []); @@ -73,9 +73,9 @@ function doTest() { check({i: {$not: {$all: ["a", "b"]}}}, []); check({i: {$not: {$all: ["c"]}}}, [["a", "b"]]); - assert.writeOK(coll.remove({})); - assert.writeOK(coll.insert({i: [{j: "a"}]})); - assert.writeOK(coll.insert({i: [{j: "b"}]})); + assert.commandWorked(coll.remove({})); + assert.commandWorked(coll.insert({i: [{j: "a"}]})); + assert.commandWorked(coll.insert({i: [{j: "b"}]})); check({i: {$not: {$elemMatch: {j: "a"}}}}, [[{j: "b"}]]); check({i: {$not: {$elemMatch: {j: "f"}}}}, [[{j: "a"}], [{j: "b"}]]); } |