diff options
Diffstat (limited to 'jstests/noPassthroughWithMongod/insertMulti.js')
-rw-r--r-- | jstests/noPassthroughWithMongod/insertMulti.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/jstests/noPassthroughWithMongod/insertMulti.js b/jstests/noPassthroughWithMongod/insertMulti.js index b857e8c159a..e2a70307550 100644 --- a/jstests/noPassthroughWithMongod/insertMulti.js +++ b/jstests/noPassthroughWithMongod/insertMulti.js @@ -4,9 +4,11 @@ "use strict"; function makeDocument(docSize) { - var doc = { "fieldName":"" }; + var doc = { + "fieldName": "" + }; var longString = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; - while(Object.bsonsize(doc) < docSize) { + while (Object.bsonsize(doc) < docSize) { if (Object.bsonsize(doc) < docSize - longString.length) { doc.fieldName += longString; } else { @@ -20,24 +22,24 @@ var t = db.foo; t.drop(); - t.insert([{_id:1},{_id:2}]); + t.insert([{_id: 1}, {_id: 2}]); assert.eq(t.count(), 2); - t.insert([{_id:3},{_id:2},{_id:4}], 0); // no ContinueOnError + t.insert([{_id: 3}, {_id: 2}, {_id: 4}], 0); // no ContinueOnError assert.eq(t.count(), 3); - assert.eq(t.count({ "_id" : 1 }), 1); - assert.eq(t.count({ "_id" : 2 }), 1); - assert.eq(t.count({ "_id" : 3 }), 1); - assert.eq(t.count({ "_id" : 4 }), 0); + assert.eq(t.count({"_id": 1}), 1); + assert.eq(t.count({"_id": 2}), 1); + assert.eq(t.count({"_id": 3}), 1); + assert.eq(t.count({"_id": 4}), 0); t.drop(); - t.insert([{_id:1},{_id:2}]); + t.insert([{_id: 1}, {_id: 2}]); assert.eq(t.count(), 2); - t.insert([{_id:3},{_id:2},{_id:4}], 1); // ContinueOnError + t.insert([{_id: 3}, {_id: 2}, {_id: 4}], 1); // ContinueOnError assert.eq(t.count(), 4); - assert.eq(t.count({ "_id" : 1 }), 1); - assert.eq(t.count({ "_id" : 2 }), 1); - assert.eq(t.count({ "_id" : 3 }), 1); - assert.eq(t.count({ "_id" : 4 }), 1); + assert.eq(t.count({"_id": 1}), 1); + assert.eq(t.count({"_id": 2}), 1); + assert.eq(t.count({"_id": 3}), 1); + assert.eq(t.count({"_id": 4}), 1); // Push a large vector in bigger than the subset size we'll break it up into t.drop(); |