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-31 17:22:22 -05:00

21 lines
295 B
JavaScript

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);