0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/core/arrayfind4.js
Jack Mulrow 00d92ece19 SERVER-31194 Add jscore tags for retryable_writes_jscore_stepdown_passthrough.yml suite
The actual suite will come in a follow-up commit.
2017-12-07 14:36:15 -05:00

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());