[SERVER-58521] Dot notation updates with arrays can lead to nonsensical results Created: 14/Jul/21 Updated: 06/Dec/22 Resolved: 22/Jul/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ross Lawley | Assignee: | Backlog - Query Optimization |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
The documentation isn't clear that dot notation behaviour with arrays using $set provides very different results than using $set with arrays. The behaviour is surprising. |
| Comments |
| Comment by Asya Kamsky [ 22/Jul/21 ] |
|
It's definitely strongly related to SERVER-24748 and while docs could be improved, without a simple way to specify index in agg update syntax, it's going to be a complex docs section. |
| Comment by David Storch [ 16/Jul/21 ] |
|
Unfortunately, I believe this is working as designed. Improving the documentation would be a good idea. Providing a language facility in pipeline-based updates to permit positional array updates, or generally improving array updates in the pipeline update language is something we considered in the past but ultimately deprioritized. I am going to reassign this to the Query Optimization team's triage queue, since this is more related to MQL semantics. |