summaryrefslogtreecommitdiff
path: root/jstests/indexy.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/indexy.js')
-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() );
+}