summaryrefslogtreecommitdiff
path: root/jstests/sharding/presplit.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/presplit.js')
-rw-r--r--jstests/sharding/presplit.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/jstests/sharding/presplit.js b/jstests/sharding/presplit.js
index 68154923ae4..6820a5fb332 100644
--- a/jstests/sharding/presplit.js
+++ b/jstests/sharding/presplit.js
@@ -12,11 +12,12 @@ while ( bigString.length < 10000 ){
db = s.getDB( "test" );
inserted = 0;
num = 0;
+var bulk = db.foo.initializeUnorderedBulkOp();
while ( inserted < ( 20 * 1024 * 1024 ) ){
- db.foo.insert( { _id : num++ , s : bigString } );
+ bulk.insert({ _id: num++, s: bigString });
inserted += bigString.length;
}
-db.getLastError();
+assert.writeOK(bulk.execute());
// Make sure that there's only one chunk holding all the data.
s.printChunks();
@@ -34,4 +35,4 @@ assert.lt( 20 , s.config.chunks.count() , "many chunks assertion" );
assert.eq( num , primary.foo.count() );
s.printChangeLog();
-s.stop(); \ No newline at end of file
+s.stop();