summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2011-12-19 14:43:25 -0800
committerAaron <aaron@10gen.com>2011-12-19 14:43:33 -0800
commit09de9bd82602ff94807cc8edd20e7eee6d712c90 (patch)
tree2c8b6fa4a85c3bb05b68db0be5d07c6d30fe534d
parent25e061ed48aad8b57e4364f2e98e28b14fc9cd28 (diff)
downloadmongo-09de9bd82602ff94807cc8edd20e7eee6d712c90.tar.gz
SERVER-4529 test
-rw-r--r--jstests/indexy.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/indexy.js b/jstests/indexy.js
new file mode 100644
index 00000000000..3f52f16590d
--- /dev/null
+++ b/jstests/indexy.js
@@ -0,0 +1,16 @@
+// Test count matching when null key is generated even though it should not be matched in a standard query. SERVER-4529
+
+t = db.jstests_indexy;
+t.drop();
+
+t.save({a:[{},{c:10}]});
+
+assert.eq( 0, t.find({'a.c':null}).itcount() );
+assert.eq( 0, t.find({'a.c':null}).count() );
+
+t.ensureIndex({'a.c':1});
+
+assert.eq( 0, t.find({'a.c':null}).itcount() );
+if( 0 ) { // SERVER-4529
+assert.eq( 0, t.find({'a.c':null}).count() );
+}