Files
mongo/jstests/core/in4.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

38 lines
582 B
JavaScript

// @tags: [requires_non_retryable_writes]
// SERVER-2343 Test $in empty array matching.
t = db.jstests_in9;
t.drop();
function someData() {
t.remove({});
t.save({key: []});
}
function moreData() {
someData();
t.save({key: [1]});
t.save({key: ['1']});
t.save({key: null});
t.save({});
}
function check() {
assert.eq(1, t.count({key: []}));
assert.eq(1, t.count({key: {$in: [[]]}}));
}
function doTest() {
someData();
check();
moreData();
check();
}
doTest();
// SERVER-1943 not fixed yet
t.ensureIndex({key: 1});
doTest();