mongo-debian/jstests/ne1.js
2010-01-31 08:32:52 +01:00

11 lines
244 B
JavaScript

t = db.ne1;
t.drop();
t.save( { x : 1 } );
t.save( { x : 2 } );
t.save( { x : 3 } );
assert.eq( 2 , t.find( { x : { $ne : 2 } } ).itcount() , "A" );
t.ensureIndex( { x : 1 } );
assert.eq( 2 , t.find( { x : { $ne : 2 } } ).itcount() , "B" );