[SERVER-53896] positional $ operator when there are two array path in query Created: 20/Jan/21 Updated: 04/Mar/21 Resolved: 09/Feb/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ali Rahbari | Assignee: | Charlie Swanson |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Sprint: | Query Optimization 2021-02-22 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
having following document:
this query:
update first element in grades instead of second one. |
| Comments |
| Comment by Charlie Swanson [ 09/Feb/21 ] |
|
Thanks for the report. This is indeed strange and unhelpful behavior. I think that this problem is already described and tracked in SERVER-18500. I'm resolving this ticket as a duplicate of that one, but please let me know if it doesn't look like the same thing to you. |
| Comment by Edwin Zhou [ 22/Jan/21 ] |
|
Thanks for your bug report. The issue seems to happen when querying an array for an element then using $set and $pull with the positional operator. $pull with the positional operator works as intended when the document contains user: 1 instead of user: [1]. However, since the document is queried by both user and grades.grade, I would expect the positional operator to preserve the match made by the grades.grade field. Best, |