summaryrefslogtreecommitdiff
path: root/jstests/noPassthroughWithMongod/ttl_sharded.js
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-04-25 14:04:36 -0400
committerRandolph Tan <randolph@10gen.com>2014-05-06 16:32:44 -0400
commit87dc3ae516e1d12a632dc604710661e38ed7b3dd (patch)
tree3a483a3d0c38ce00a7f4d7dba0e9cba7f7eba5f3 /jstests/noPassthroughWithMongod/ttl_sharded.js
parent6b945ec15c61f6bd4bfbaf382624d886ec8441d2 (diff)
downloadmongo-87dc3ae516e1d12a632dc604710661e38ed7b3dd.tar.gz
SERVER-13741 Migrate remaining tests to use write commands
Diffstat (limited to 'jstests/noPassthroughWithMongod/ttl_sharded.js')
-rw-r--r--jstests/noPassthroughWithMongod/ttl_sharded.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/jstests/noPassthroughWithMongod/ttl_sharded.js b/jstests/noPassthroughWithMongod/ttl_sharded.js
index d5aa45e269a..2c524d8d788 100644
--- a/jstests/noPassthroughWithMongod/ttl_sharded.js
+++ b/jstests/noPassthroughWithMongod/ttl_sharded.js
@@ -20,11 +20,12 @@ s.adminCommand( { shardcollection : ns , key: { _id : 1 } } );
// insert 24 docs, with timestamps at one hour intervals
var now = (new Date()).getTime();
-for ( i=0; i<24; i++ ){
+var bulk = t.initializeUnorderedBulkOp();
+for (var i = 0; i < 24; i++) {
var past = new Date( now - ( 3600 * 1000 * i ) );
- t.insert( {_id : i , x : past } );
+ bulk.insert({ _id: i, x: past });
}
-s.getDB( dbname ).getLastError();
+assert.writeOK(bulk.execute());
assert.eq( t.count() , 24 , "initial docs not inserted");
// create the TTL index which delete anything older than ~5.5 hours