Files
mongo/jstests/core/query/array/arrayfind4.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
709 B
JavaScript
Raw Normal View History

// @tags: [
// requires_non_retryable_writes,
// ]
2011-07-31 08:44:33 -07:00
// Test query empty array SERVER-2258
let t = db.jstests_arrayfind4;
2011-07-31 08:44:33 -07:00
t.drop();
t.save({a: []});
t.createIndex({a: 1});
2011-07-31 08:44:33 -07:00
assert.eq(1, t.find({a: []}).hint({$natural: 1}).itcount());
assert.eq(1, t.find({a: []}).hint({a: 1}).itcount());
2011-07-31 08:44:33 -07:00
assert.eq(1, t.find({a: {$in: [[]]}}).hint({$natural: 1}).itcount());
assert.eq(1, t.find({a: {$in: [[]]}}).hint({a: 1}).itcount());
2011-07-31 08:44:33 -07:00
t.remove({});
t.save({a: [[]]});
2011-07-31 08:44:33 -07:00
assert.eq(1, t.find({a: []}).hint({$natural: 1}).itcount());
assert.eq(1, t.find({a: []}).hint({a: 1}).itcount());
2011-07-31 08:44:33 -07:00
assert.eq(1, t.find({a: {$in: [[]]}}).hint({$natural: 1}).itcount());
assert.eq(1, t.find({a: {$in: [[]]}}).hint({a: 1}).itcount());