[DOCS-15453] Investigate changes in SERVER-54046: Permit empty objects as expressions in $set and $addFields aggregation stages Created: 28/Jun/22 Updated: 13/Nov/23 Resolved: 30/Sep/22 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual, Server |
| Affects Version/s: | 6.1.0 |
| Fix Version/s: | 6.1.0-rc0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Backlog - Core Eng Program Management Team | Assignee: | Jocelyn Mendez |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Days since reply: | 1 year, 8 weeks, 2 days ago | ||||||||
| Epic Link: | DOCSP-21764 | ||||||||
| Story Points: | 3 | ||||||||
| Description |
|
Original Downstream Change Summary $addFields and $set will no longer throw an error if you want to set a path to an empty object. Description of Linked TicketPermit empty objects as expressions in $set and $addFields aggregation stages. For example, an aggregation stage definition
should be accepted and should add field "a: {}" to the resulting object (this looks like an intuitively expected system behavior). Nesting of objects should be supported, like in a following example:
Currently, to achieve this behavior a wrapper expression $literal has to be used like this:
But an aggregation stage definition
is accepted and results in field "a: []", which is somewhat inconsistent with handling of empty objects. $set update operator expression with a field with an empty object
is accepted. Furthermore, we have recently relaxed restrictions for update modifiers ( Currently, execution of a $set aggregation stage with an empty object as an expression, like
fails with the following error message: "Invalid $set :: caused by :: an empty object is not a valid value. Found empty object at path a". |
| Comments |
| Comment by Githook User [ 12/Dec/22 ] |
|
Author: {'name': 'jocelyn-mendez1', 'email': '91144778+jocelyn-mendez1@users.noreply.github.com', 'username': 'jocelyn-mendez1'}Message:
|
| Comment by Githook User [ 29/Sep/22 ] |
|
Author: {'name': 'jocelyn-mendez1', 'email': '91144778+jocelyn-mendez1@users.noreply.github.com', 'username': 'jocelyn-mendez1'}Message:
|
| Comment by Education Bot [ 28/Jun/22 ] |
|
Fix Version updated for upstream |