[SERVER-30098] Projections using dot notation to select an array element don't work Created: 11/Jul/17 Updated: 27/Oct/23 Resolved: 11/Jul/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Billy Tetrud | Assignee: | Kelsey Schubert |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
I would expect the above to return documents like:
but instead returns all elements of the array, just as empty objects:
This doesn't make any sense. It seem broken. |
| Comments |
| Comment by Kelsey Schubert [ 11/Jul/17 ] | |
|
Hi fresheneesz, Please note that this behavior is documented. I would recommend using the $slice to achieve the functionality you're looking for:
Kind regards, | |
| Comment by Billy Tetrud [ 11/Jul/17 ] | |
|
Thanks Thomas! | |
| Comment by Billy Tetrud [ 11/Jul/17 ] | |
|
Ugh, freaking jira "preformatted" style didn't work.. why can't I edit the ticket I created? Well... ignore the first two and last two curly braces then... |