Files
mongo/jstests/core/countb.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

12 lines
459 B
JavaScript

// Test fast count mode with single key index unsatisfiable constraints on a multi key index.
t = db.jstests_countb;
t.drop();
t.ensureIndex( {a:1} );
t.save( {a:['a','b']} );
assert.eq( 0, t.find( {a:{$in:['a'],$gt:'b'}} ).count() );
assert.eq( 0, t.find( {$and:[{a:'a'},{a:{$gt:'b'}}]} ).count() );
assert.eq( 1, t.find( {$and:[{a:'a'},{$where:"this.a[1]=='b'"}]} ).count() );
assert.eq( 0, t.find( {$and:[{a:'a'},{$where:"this.a[1]!='b'"}]} ).count() );