summaryrefslogtreecommitdiff
path: root/jstests/indexe.js
blob: 213f7c74cf08c857d99e6060ec4c0e6675ed0185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

t = db.indexe;
t.drop();

num = 100000;

for ( i=0; i<num; i++){
    t.insert( { a : "b" } );
}

assert.eq( num , t.find().count() ,"A1" );
assert.eq( num , t.find( { a : "b" } ).count() , "B1" );
assert.eq( num , t.find( { a : "b" } ).itcount() , "C1" );

t.ensureIndex( { a : 1 } );

assert.eq( num , t.find().count() ,"A2" );
assert.eq( num , t.find().sort( { a : 1 } ).count() , "A2a" );
assert.eq( num , t.find( { a : "b" } ).count() , "B2" );
assert.eq( num , t.find( { a : "b" } ).itcount() , "C3" );

t.drop();