diff options
author | Randolph Tan <randolph@10gen.com> | 2014-03-03 11:27:18 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2014-03-14 12:05:05 -0400 |
commit | eb41492c6f1228077b92239524e4a607b70cd8e3 (patch) | |
tree | c90485d43753aa756063d0a6e8f67b8843931bba /jstests/replsets/initial_sync4.js | |
parent | e44682821c37fdf3d4fd8cb58dcf5c34181ddbde (diff) | |
download | mongo-eb41492c6f1228077b92239524e4a607b70cd8e3.tar.gz |
SERVER-13190 migrate replset jstest suite to use write commands api
Diffstat (limited to 'jstests/replsets/initial_sync4.js')
-rw-r--r-- | jstests/replsets/initial_sync4.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/jstests/replsets/initial_sync4.js b/jstests/replsets/initial_sync4.js index 0b556fe0dfd..9e0d869d62f 100644 --- a/jstests/replsets/initial_sync4.js +++ b/jstests/replsets/initial_sync4.js @@ -13,12 +13,13 @@ md = m.getDB("d"); mc = m.getDB("d")["c"]; print("2. Insert some data"); -N = 50000; -mc.ensureIndex({x:1}) +N = 5000; +mc.ensureIndex({x:1}); +var bulk = mc.initializeUnorderedBulkOp(); for( i = 0; i < N; ++i ) { - mc.save( {_id:i,x:i,a:{}} ); + bulk.insert({ _id: i, x: i, a: {} }); } -md.getLastError(); +assert.writeOK(bulk.execute()); print("3. Make sure synced"); replTest.awaitReplication(); |