mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
17 lines
225 B
JavaScript
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);
|