summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@10gen.com>2011-08-31 14:58:44 -0400
committerSpencer T Brody <spencer@10gen.com>2011-08-31 14:59:40 -0400
commit7f9fa28a4d008582ac63ba31c9f15cdb55913fb3 (patch)
tree8f4707a827353874b0d2796c5e15c260a77c4637
parent56122624cfaa36058c13b8174c94265ca74c3aa7 (diff)
downloadmongo-7f9fa28a4d008582ac63ba31c9f15cdb55913fb3.tar.gz
Extend tests for $exists accepting 1 and 0 so that the tests can catch SERVER-2322.
-rw-r--r--jstests/exists7.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/jstests/exists7.js b/jstests/exists7.js
index bb379cf48d5..14a972038c5 100644
--- a/jstests/exists7.js
+++ b/jstests/exists7.js
@@ -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();