Files
mongo/jstests/core/count4.js
Randolph Tan 5595b94560 SERVER-12127 migrate js tests to jscore suite when not related to writes
Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
2014-02-28 16:26:33 -05:00

18 lines
332 B
JavaScript

t = db.count4;
t.drop();
for ( i=0; i<100; i++ ){
t.save( { x : i } );
}
q = { x : { $gt : 25 , $lte : 75 } }
assert.eq( 50 , t.find( q ).count() , "A" );
assert.eq( 50 , t.find( q ).itcount() , "B" );
t.ensureIndex( { x : 1 } );
assert.eq( 50 , t.find( q ).count() , "C" );
assert.eq( 50 , t.find( q ).itcount() , "D" );