summaryrefslogtreecommitdiff
path: root/jstests/index_check1.js
blob: a33e062a8281ba8df91ae78191b6586cf103bc54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

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