[SERVER-28761] Implement UpdateObjectNode::apply() Created: 12/Apr/17  Updated: 12/Oct/17  Resolved: 25/May/17

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.5.8

Type: Task Priority: Major - P3
Reporter: Tess Avitabile (Inactive) Assignee: Tess Avitabile (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-28758 Implement UpdateNode::mergeTrees() Closed
depends on SERVER-28759 Implement SetNode::apply() Closed
is depended on by SERVER-28762 Conditionally parse an update express... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query 2017-05-29
Participants:

 Description   

Implement the following method:

Status apply(mutablebson::Element element, 
FieldRef pathToCreate, 
FieldRef pathTaken, 
StringData matchedField, 
UpdateIndexData indexData,
LogBuilder* logBuilder, 
bool* indexesAffected, 
bool* noop) final;

This should iterate through each of the node's children, recursively calling apply() on each child. If pathToCreate is empty and the child’s field exists in the current element, it passes that field as element. Otherwise, it appends the field to the end of pathToCreate and passes the entire current element as element. If the field is "$", it is replaced with matchedField. If there was already a child matchedField, the children must be cloned and merged using UpdateNode::mergeTrees(), and apply() called on the result. Before moving on to the next child, it checks whether the fields along pathToCreate were created, and if so, it resets element to the end of pathToCreate and resets pathToCreate to “”.

indexesAffected and noop are computed by OR-ing and AND-ing the results of the children, respectively. logBuilder is simply forwarded to children.



 Comments   
Comment by Githook User [ 25/May/17 ]

Author:

{u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}

Message: SERVER-28761 Implement UpdateObjectNode::apply()
Branch: master
https://github.com/mongodb/mongo/commit/e761432fa04c0a6bdf4b38d4d6268f492825b903

Generated at Thu Feb 08 04:18:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.