[SERVER-46708] Support 'let' variables in update command Created: 09/Mar/20  Updated: 29/Oct/23  Resolved: 28/Apr/20

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Write Ops
Affects Version/s: None
Fix Version/s: 4.7.0

Type: New Feature Priority: Major - P3
Reporter: Charlie Swanson Assignee: Katherine Wu (Inactive)
Resolution: Fixed Votes: 0
Labels: qopt-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-46115 Implement 'let' parameters to aggrega... Closed
depends on SERVER-46737 Support 'let' variables for the find ... Closed
depends on SERVER-46772 Use IDL to represent UpdateRequest Closed
is depended on by SERVER-46715 Support 'let' parameter in findAndMod... Closed
is depended on by SERVER-46716 Support 'let' parameters for updates ... Closed
is depended on by SERVER-46998 Support 'let' variables used within $... Closed
Documented
is documented by DOCS-13620 Investigate changes in SERVER-46708: ... Closed
Related
is related to SERVER-73231 Support top-level 'let' variable in b... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2020-05-04
Participants:

 Description   

Replace the 'runtimeConstants' support with the new 'let' syntax from the aggregate command in the update command. Similar to how that works, we should support both a top-level 'let' parameter to the update request and also a parameter for each update in the batch request. For now, let's stick with the name 'c' for the constants for each update in the batch, though we may revisit this name later.

Note that we will have to preserve support for 'runtimeConstants' for compatibility during upgrade. There will be a problem where an internal update request built on behalf of $merge will need to specify variables. This is done here. It's important for those variables/constants to be serialized as runtimeConstants, again for compatibility during upgrade. I would recommend making this work as part of this ticket, but if it becomes obvious how to split it into follow-up work we should do that.

For this work, focus only on unsharded deployments.



 Comments   
Comment by Githook User [ 28/Apr/20 ]

Author:

{'name': 'Katherine Wu', 'email': 'katherine.wu@mongodb.com', 'username': 'kaywux'}

Message: SERVER-46708 Support let variables in update command
Branch: master
https://github.com/mongodb/mongo/commit/53e1d78e950bb98f84fc0e0e48c341404f7f90ed

Generated at Thu Feb 08 05:12:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.