0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/exists7.js
2011-04-21 11:00:19 -07:00

19 lines
383 B
JavaScript

// Test that non boolean value types are allowed with $explain spec. SERVER-2322
t = db.jstests_explain7;
t.drop();
function testIntegerExistsSpec() {
t.remove();
t.save( {} );
t.save( {a:1} );
assert.eq( 1, t.count( {a:{$exists:1}} ) );
assert.eq( 1, t.count( {a:{$exists:0}} ) );
}
testIntegerExistsSpec();
t.ensureIndex( {a:1} );
testIntegerExistsSpec();