blob: 87e99898b1f5d155ba4c93c1807e5d8a0a4b2c6a (
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
27
28
29
30
|
t = db.index_many2;
t.drop();
t.save({x: 1});
assert.eq(1, t.getIndexKeys().length, "A1");
function make(n) {
var x = {};
x["x" + n] = 1;
return x;
}
for (i = 1; i < 1000; i++) {
t.ensureIndex(make(i));
}
assert.eq(64, t.getIndexKeys().length, "A2");
num = t.getIndexKeys().length;
t.dropIndex(make(num - 1));
assert.eq(num - 1, t.getIndexKeys().length, "B0");
t.ensureIndex({z: 1});
assert.eq(num, t.getIndexKeys().length, "B1");
t.dropIndex("*");
assert.eq(1, t.getIndexKeys().length, "C1");
|