summaryrefslogtreecommitdiff
path: root/jstests/indexv.js
blob: a69ff2a4664d470650eacaa9fbf94e8603a50615 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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 );