mongo/jstests/core/query/array/arrayfind4.js
Joshua Siegel 169f8dc283 SERVER-111817 Add tag to exclude tests from timeseries CRUD suite (#44113)
GitOrigin-RevId: a3ab3b89275fa89c9824f6af467d56d605096159
2025-11-21 18:08:16 +00:00

54 lines
1022 B
JavaScript

// @tags: [
// requires_non_retryable_writes,
// requires_getmore,
// # Time series collections do not support indexing array values in measurement fields.
// exclude_from_timeseries_crud_passthrough,
// ]
// Test query empty array SERVER-2258
let t = db.jstests_arrayfind4;
t.drop();
t.save({a: []});
t.createIndex({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(),
);