[SERVER-15266] $elemMatch/$all behavior in version 2.6.1 Created: 16/Sep/14 Updated: 18/Sep/14 Resolved: 18/Sep/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.6.4, 2.7.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | krishna | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
I have created an db with the following structure
and i have used the following query in mongodb version 2.4.6, it has given the correct output
but the same query i have used in mongodb version 2.6.1 it is neither throwing any error nor giving any result |
| Comments |
| Comment by Ramon Fernandez Marina [ 18/Sep/14 ] | ||||
|
krishna114, this is a bug in 2.4 that was corrected in 2.6. MongoDB 2.6 does not recursively index nested arrays, and does not recursively traverse them in the matcher to look for nested array elements which match the query, so the behavior you're observing is expected. This is consistent with the documentation for $all query operator. Please see Regards, | ||||
| Comment by krishna [ 16/Sep/14 ] | ||||
|
hi @Ramon Fernandez , please find the following commands and try these in different versions , { "c" : "aaa", "d" : "ddd" }], [ "cc","dd", {"a" : "cc","b" : "dd" }, { "a" : "aaa", "b" : "ddd" }] ]}) }}) | ||||
| Comment by Ramon Fernandez Marina [ 16/Sep/14 ] | ||||
|
krishna114, thanks for your report, I'm able to reproduce the behavior you describe with the following code:
I can also confirm that the behavior in the 2.4 series is different. This could be a corner case of |