mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
27 lines
726 B
JavaScript
27 lines
726 B
JavaScript
db = connect("ed_db_index_check1");
|
|
|
|
db.somecollection.drop();
|
|
|
|
assert(db.system.namespaces.find({name:/somecollection/}).length() == 0);
|
|
|
|
db.somecollection.save({a:1});
|
|
|
|
assert(db.system.namespaces.find({name:/somecollection/}).length() == 1);
|
|
|
|
db.somecollection.ensureIndex({a:1});
|
|
|
|
assert(db.system.namespaces.find({name:/somecollection/}).length() == 2);
|
|
|
|
db.somecollection.drop();
|
|
|
|
assert(db.system.namespaces.find({name:/somecollection/}).length() == 0);
|
|
|
|
db.somecollection.save({a:1});
|
|
|
|
assert(db.system.namespaces.find({name:/somecollection/}).length() == 1);
|
|
|
|
db.somecollection.ensureIndex({a:1});
|
|
|
|
assert(db.system.namespaces.find({name:/somecollection/}).length() == 2);
|
|
|
|
assert(db.somecollection.validate().valid); |