[SERVER-9028] Using positional operator with db.collection.find() to fetch multiple embedded documents does not work as expected Created: 20/Mar/13 Updated: 10/Dec/14 Resolved: 07/Apr/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Alexey Kamensky | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Platform: Ubuntu 12.10 x64 |
||
| Issue Links: |
|
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
I am not very sure whether this is bug, or that was intention to limit functionality this way. However here is the description: PRECONDITIONS:
Root document: , , STEPS TO REPRODUCE:
EXPECTED OUTCOME:
ACTUAL OUTCOME:
As it is stated in ACTUAL OUTCOME block, the expected outcome is based on behavior with similar query but for finding single document. , {'subdocuments.$': 1, _id:0})" works, whereas "db.collection.find( {'subdocuments.test': /test/i}, {'subdocuments.$': 1, _id:0})" doesn't. Why is this important? |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 07/Apr/13 ] |
|
This feature request (returning multiple matches, instead of just one) in here: The regex positional operator issue is here: |
| Comment by Ronald Stalder [ 07/Apr/13 ] |
|
From: http://stackoverflow.com/questions/15496071/finding-embedded-documents-in-mongoose-odm Issue can be reproduced in mongo shell > db.xx.find().pretty() , { "number" : 4, "name" : "aka" } ] ,{_id:0, "subsets.$":1}) ] } ,{_id:0, "subsets.$":1}) }},{_id:0, "subsets.$":1}) ] } |