summaryrefslogtreecommitdiff
path: root/jstests/sharding/cursor_cleanup.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/cursor_cleanup.js')
-rw-r--r--jstests/sharding/cursor_cleanup.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/jstests/sharding/cursor_cleanup.js b/jstests/sharding/cursor_cleanup.js
index a28b5416e38..758b60c4e5c 100644
--- a/jstests/sharding/cursor_cleanup.js
+++ b/jstests/sharding/cursor_cleanup.js
@@ -24,11 +24,14 @@ st.printShardingStatus(true);
jsTest.log("Insert enough data to overwhelm a query batch.");
+var bulk = coll.initializeUnorderedBulkOp();
+var bulk2 = collUnsharded.initializeUnorderedBulkOp();
for (var i = -150; i < 150; i++) {
- coll.insert({ _id : i });
- collUnsharded.insert({ _id : i });
+ bulk.insert({ _id : i });
+ bulk2.insert({ _id : i });
}
-assert.eq(null, coll.getDB().getLastError());
+assert.writeOK(bulk.execute());
+assert.writeOK(bulk2.execute());
jsTest.log("Open a cursor to a sharded and unsharded collection.");