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/background_index_multikey.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/background_index_multikey.js')
-rw-r--r-- | jstests/core/background_index_multikey.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/jstests/core/background_index_multikey.js b/jstests/core/background_index_multikey.js index 3db0c2d81f1..e9d0f0aa9ed 100644 --- a/jstests/core/background_index_multikey.js +++ b/jstests/core/background_index_multikey.js @@ -15,7 +15,7 @@ function testIndexBuilds(isBackground) { // Build index after multikey document is in the collection. let doc = {_id: 0, a: [1, 2]}; - assert.writeOK(coll.insert(doc)); + assert.commandWorked(coll.insert(doc)); assert.commandWorked(coll.createIndex({a: 1}, {background: isBackground})); assert.eq(1, coll.count({a: 1})); assert.eq(doc, coll.findOne({a: 1})); @@ -24,7 +24,7 @@ function testIndexBuilds(isBackground) { // Build index where multikey is in an embedded document. doc = {_id: 1, b: {c: [1, 2]}}; - assert.writeOK(coll.insert(doc)); + assert.commandWorked(coll.insert(doc)); assert.commandWorked(coll.createIndex({'b.c': 1}, {background: isBackground})); assert.eq(1, coll.count({'b.c': 1})); assert.eq(doc, coll.findOne({'b.c': 1})); @@ -33,7 +33,7 @@ function testIndexBuilds(isBackground) { // Add new multikey path to embedded path. doc = {_id: 2, b: [1, 2]}; - assert.writeOK(coll.insert(doc)); + assert.commandWorked(coll.insert(doc)); assert.eq(1, coll.count({b: 1})); assert.eq(doc, coll.findOne({b: 1})); assert.eq(1, coll.count({b: 2})); @@ -41,11 +41,11 @@ function testIndexBuilds(isBackground) { // Build index on a large collection that is not multikey, and then make it multikey. for (let i = 100; i < 1100; i++) { - assert.writeOK(coll.insert({_id: i, d: i})); + assert.commandWorked(coll.insert({_id: i, d: i})); } assert.commandWorked(coll.createIndex({d: 1}, {background: isBackground})); doc = {_id: 3, d: [1, 2]}; - assert.writeOK(coll.insert(doc)); + assert.commandWorked(coll.insert(doc)); assert.eq(1, coll.count({d: 1})); assert.eq(doc, coll.findOne({d: 1})); assert.eq(1, coll.count({d: 2})); @@ -53,7 +53,7 @@ function testIndexBuilds(isBackground) { // Build compound multikey index. doc = {_id: 4, e: [1, 2]}; - assert.writeOK(coll.insert(doc)); + assert.commandWorked(coll.insert(doc)); assert.commandWorked(coll.createIndex({'e': 1, 'f': 1}, {background: isBackground})); assert.eq(1, coll.count({e: 1})); assert.eq(doc, coll.findOne({e: 1})); @@ -62,7 +62,7 @@ function testIndexBuilds(isBackground) { // Add new multikey path to compound index. doc = {_id: 5, f: [1, 2]}; - assert.writeOK(coll.insert(doc)); + assert.commandWorked(coll.insert(doc)); assert.eq(1, coll.count({f: 1})); assert.eq(doc, coll.findOne({f: 1})); assert.eq(1, coll.count({f: 2})); |