[SERVER-2343] $in check for empty array does not work Created: 10/Jan/11  Updated: 12/Jul/16  Resolved: 25/Mar/11

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 1.6.5
Fix Version/s: 1.9.0

Type: Bug Priority: Minor - P4
Reporter: Christof Koenig Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 10.04.1 LTS, db version v1.6.5, pdfile version 4.5


Issue Links:
Depends
depends on SERVER-2829 arrays do not match themselves when p... Closed
Operating System: ALL
Participants:

 Description   

The following example is based on the in6.js test:

t = db.jstests_in6;
t.drop();

t.save(

{key: []}

);
t.save(

{key: [1]}

);
t.save(

{key: ['1']}

);
t.save(

{key: null}

);
t.save( {} );

function doTest() {
assert.eq.automsg( "1", "t.count(

{key:[]}

)" );
assert.eq.automsg( "1", "t.count( {key:{$in:[[]]}} )" );
}

doTest();
t.ensureIndex(

{i:1}

);
doTest();

The first query using

{key: []}

works as expected as long as there is no index (seems to be the same as http://jira.mongodb.org/browse/SERVER-1943), but the second query {key:{$in:[[]]}} returns nothing in both cases.



 Comments   
Comment by auto [ 25/Mar/11 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-2343 SERVER-1943 test
https://github.com/mongodb/mongo/commit/02162fa52bccc9314aed2a7f78caee78149d7d7f

Generated at Thu Feb 08 02:59:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.