summaryrefslogtreecommitdiff
path: root/jstests/core/indexv.js
blob: 638de158aa49b5f7f65ad87342fad628b6c5ff91 (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("executionStats");
assert.eq(1, e.executionStats.nReturned);
assert.eq(1, e.executionStats.totalKeysExamined);

t.drop();
t.ensureIndex({'a.b.c': 1});
t.save({a: [{b: []}, {b: {c: 1}}]});
var e = t.find({'a.b.c': null}).explain("executionStats");
assert.eq(0, e.executionStats.nReturned);
assert.eq(1, e.executionStats.totalKeysExamined);