-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
Critical - P2
-
None
-
Affects Version/s: 2.11.1
-
Component/s: API
-
None
-
Environment:Mac OS X
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In one collection I have an embedded array of ObjectIds. The name of the array is "user_ids". I wrote a query to fetch all elements from the collection where the array has at least 1 element. The native MongoDB query looks like this:
db.mycollection.find( {"user_ids.0" :
{ "$exists" : true }} )
and it works fine. It returns 2 elements. In Java I did it like this:
query.put("user_ids.0", new BasicDBObject("$exists", Boolean.TRUE) );
Unfortunately it returns only 1 element. 1 is missing.
It looks like a bug.