blob: 026806429391ebe2d7dcc9bf4c0ffba922b56639 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// SERVER-2829 Test arrays matching themselves within a $in expression.
t = db.jstests_in8;
t.drop();
t.save({key: [1]});
t.save({key: ['1']});
t.save({key: [[2]]});
function doTest() {
assert.eq(1, t.count({key: [1]}));
assert.eq(1, t.count({key: {$in: [[1]]}}));
assert.eq(1, t.count({key: {$in: [[1]], $ne: [2]}}));
assert.eq(1, t.count({key: {$in: [['1']], $type: 2}}));
assert.eq(1, t.count({key: ['1']}));
assert.eq(1, t.count({key: {$in: [['1']]}}));
assert.eq(1, t.count({key: [2]}));
assert.eq(1, t.count({key: {$in: [[2]]}}));
}
doTest();
t.ensureIndex({key: 1});
doTest();
|