0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/index3.js
2009-01-26 23:28:26 -05:00

22 lines
317 B
JavaScript

db = connect( "foo");
t = db.index3;
t.dropIndexes();
t.remove( {} );
sleep( 100 );
assert( t.getIndexes().length() == 0 );
t.ensureIndex( { name : 1 } );
sleep( 100 );
t.save( { name : "a" } );
t.ensureIndex( { name : 1 } );
sleep( 1000 );
assert( t.getIndexes().length() == 1 );
assert(t.validate().valid);