[SERVER-12846] v2.6.0-rc0 update $pop - changed behaviour + removes incorrect data Created: 23/Feb/14 Updated: 11/Jul/16 Resolved: 12/Mar/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 2.6.0-rc0 |
| Fix Version/s: | 2.6.0-rc2 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Roman Kuzmin | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Major Change |
| Operating System: | ALL |
| Participants: |
| Description |
|
The steps: Step 1.
Step 2.
The above pop fails and data are not changed. In v2.4.9 this nonsense pop was silently ignored (if I am not mistaken). Step 3.
The result is presumably incorrect. {$pop : {"a.3" : 1}} instead of failing (like with a.-2 in v2.6) or doing nothing (like with the same case in v2.4.9) it removes data from 'a' itself, i.e. actually performs another operation: {$pop : {"a" : 1}}. |
| Comments |
| Comment by Githook User [ 12/Mar/14 ] |
|
Author: {u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by Daniel Pasette (Inactive) [ 25/Feb/14 ] |
|
The two cases are a bit different, the first case is an illegal identifier for an array, and thus there is an error. The second case (step 3.) is consistent with 2.4.9, and is akin to querying for data that does not exist and shouldn't return an error. The bug here is that the document is modified. Thanks for the report. |