[SERVER-1678] Query on a field of deep nested arrays and dictionaries don't find all document Created: 25/Aug/10 Updated: 07/Mar/14 Resolved: 31/Aug/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | kosii | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Operating System: | ALL |
| Participants: |
| Description |
|
I've got this 3 document in a collection: http://pastie.org/1114659 , and I have these query objects: {'fields.5.3.0': 31}(nº1) {'fields.5.6.0': 31} (nº2) ).count() ).count() Am I mistaking somewhere? |
| Comments |
| Comment by kosii [ 31/Aug/10 ] |
|
Ok, thank you. |
| Comment by Mathias Stearn [ 28/Aug/10 ] |
|
I think I found the cause. The issue is that for one of the objects it takes the '3' in your query to be an index into the array. Take a look at the output from these calls: > db.foo.findOne( {'fields.5.3.0': 31})._id )._id )._id I think the best solution is not to mix numeric keys and arrays due to the ambiguity that they introduce. |
| Comment by kosii [ 25/Aug/10 ] |
|
In the javascript file I've put 4 object in a collection (v, w, x, y). In order to get w and y objects, I respectively changed a field name from '3' to '6' in v and x object. I wrote two queries also ( {'fields.5.3.0': 31}and {'fields.5.6.0': 31}), they are different only on the field name. The first query only matches one document |
| Comment by Eliot Horowitz (Inactive) [ 25/Aug/10 ] |
|
I only see 1 document that should match the first query. If you think there is an error, please provide a .js file with the full example. |