[SERVER-31822] Update $push with empty $each reports nModified = 1 on MongoDB 3.4 Created: 03/Nov/17 Updated: 27/Oct/23 Resolved: 03/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 3.4.10 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Robert Guo (Inactive) | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | ufz | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query
|
| Operating System: | ALL |
| Participants: |
| Description |
|
An update operation with an empty $push and an empty $each on an empty array gets reported as nModified = 1 on MongoDB 3.4, even though no documents have been modified. The command result on 3.6 seems to be more correct. There's no difference between the behavior of the command on 3.6 and previous versions.
|
| Comments |
| Comment by Asya Kamsky [ 03/Jan/18 ] |
|
Recommend "won't fix" as resolution. |
| Comment by Justin Seyster [ 06/Nov/17 ] |
|
I would characterize this as a minor oversight in the previous implementation of the update system. The $push modifier in modifier_push.cpp does not check for no-op cases, because this is the only one, and it probably won't appear in practice. The new implementation does check, however: |