Permalink
Browse files

Extend tests for $exists accepting 1 and 0 so that the tests can catc…

…h SERVER-2322.
  • Loading branch information...
1 parent 5612262 commit 7f9fa28a4d008582ac63ba31c9f15cdb55913fb3 @stbrody stbrody committed Aug 31, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 jstests/exists7.js
View
@@ -8,11 +8,14 @@ function testIntegerExistsSpec() {
t.remove();
t.save( {} );
t.save( {a:1} );
+ t.save( {a:2} );
+ t.save( {a:3, b:3} );
+ t.save( {a:4, b:4} );
- assert.eq( 1, t.count( {a:{$exists:1}} ) );
- assert.eq( 1, t.count( {a:{$exists:0}} ) );
+ assert.eq( 2, t.count( {b:{$exists:1}} ) );
+ assert.eq( 3, t.count( {b:{$exists:0}} ) );
}
testIntegerExistsSpec();
-t.ensureIndex( {a:1} );
+t.ensureIndex( {b:1} );
testIntegerExistsSpec();

0 comments on commit 7f9fa28

Please sign in to comment.