mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
00d92ece19
The actual suite will come in a follow-up commit.
25 lines
694 B
JavaScript
25 lines
694 B
JavaScript
// @tags: [requires_non_retryable_writes]
|
|
|
|
// Test query empty array SERVER-2258
|
|
|
|
t = db.jstests_arrayfind4;
|
|
t.drop();
|
|
|
|
t.save({a: []});
|
|
t.ensureIndex({a: 1});
|
|
|
|
assert.eq(1, t.find({a: []}).hint({$natural: 1}).itcount());
|
|
assert.eq(1, t.find({a: []}).hint({a: 1}).itcount());
|
|
|
|
assert.eq(1, t.find({a: {$in: [[]]}}).hint({$natural: 1}).itcount());
|
|
assert.eq(1, t.find({a: {$in: [[]]}}).hint({a: 1}).itcount());
|
|
|
|
t.remove({});
|
|
t.save({a: [[]]});
|
|
|
|
assert.eq(1, t.find({a: []}).hint({$natural: 1}).itcount());
|
|
assert.eq(1, t.find({a: []}).hint({a: 1}).itcount());
|
|
|
|
assert.eq(1, t.find({a: {$in: [[]]}}).hint({$natural: 1}).itcount());
|
|
assert.eq(1, t.find({a: {$in: [[]]}}).hint({a: 1}).itcount());
|