[JAVA-826] Array.0 exists true doesn't work correct Created: 09/May/13 Updated: 25/Jun/13 Resolved: 23/May/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | API |
| Affects Version/s: | 2.11.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Robert Reiz | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Mac OS X |
||
| Description |
|
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. |
| Comments |
| Comment by Jeffrey Yemin [ 23/May/13 ] | ||||||||||||||
|
Since we haven't heard back from you, we're going to assume this is not a bug, but please feel free to re-open. | ||||||||||||||
| Comment by Jeffrey Yemin [ 09/May/13 ] | ||||||||||||||
|
I tried to reproduce this, but could not. This code:
Produced this output:
|