[SERVER-6614] When matching multiple items in inner collections / document arrays, selecting with { 'innerCollection.$' : 1 } only returns the lastest of the matched element. Created: 26/Jul/12 Updated: 11/Jan/23 Resolved: 21/Aug/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.2.0-rc0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gabriel Lesperance | Assignee: | Ben Becker |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
When matching multiple items in inner collections / document arrays, selecting with { 'innerCollection.$' : 1 }only returns one of the matched element. e.g.: > db.testCollection.insert({ name : 'Albert', innerCollection : [ {memberId: 'red'}, {memberId : 'green'} ] }) , {memberId : 'blue'} ] }) , {memberId : 'blue'}] }) > db.testCollection.find({ $and : [ {'innerCollection.memberId' : 'blue'}, {'innerCollection.memberId' : 'red'}]}, {'innerCollection.$' : 1}) ] } properly finds the requested documents, but the innerCollection item only returns the element matching { 'innerCollection.memberId' : 'red' }. |
| Comments |
| Comment by Githook User [ 11/Jan/23 ] |
|
(Sorry for this wrong commit message posted here. Server ticket attached to this commit message is wrong. Please refer
|