summaryrefslogtreecommitdiff
path: root/jstests/indexv.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/indexv.js')
-rw-r--r--jstests/indexv.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/indexv.js b/jstests/indexv.js
new file mode 100644
index 0000000..a69ff2a
--- /dev/null
+++ b/jstests/indexv.js
@@ -0,0 +1,18 @@
+// Check null key generation.
+
+t = db.jstests_indexv;
+t.drop();
+
+t.ensureIndex( {'a.b':1} );
+
+t.save( {a:[{},{b:1}]} );
+var e = t.find( {'a.b':null} ).explain();
+assert.eq( 0, e.n );
+assert.eq( 1, e.nscanned );
+
+t.drop();
+t.ensureIndex( {'a.b.c':1} );
+t.save( {a:[{b:[]},{b:{c:1}}]} );
+var e = t.find( {'a.b.c':null} ).explain();
+assert.eq( 0, e.n );
+assert.eq( 1, e.nscanned );