summaryrefslogtreecommitdiff
path: root/jstests/core/indexf.js
blob: d65e7b1c898c64d6253e7e95534fc7ce22c5925b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13

t = db.indexf
t.drop();

t.ensureIndex( { x : 1 } );

t.save( { x : 2 } );
t.save( { y : 3 } );
t.save( { x : 4 } );

assert.eq( 2 , t.findOne( { x : 2 } ).x , "A1" );
assert.eq( 3 , t.findOne( { x : null } ).y , "A2" );
assert.eq( 4 , t.findOne( { x : 4 } ).x , "A3" );