0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00
mongodb/jstests/index3.js
2009-05-14 10:30:22 -04:00

17 lines
225 B
JavaScript

t = db.index3;
t.drop();
assert( t.getIndexes().length == 0 );
t.ensureIndex( { name : 1 } );
t.save( { name : "a" } );
t.ensureIndex( { name : 1 } );
assert( t.getIndexes().length == 2 );
assert(t.validate().valid);