|
Create the interface UpdateNode and subclasses UpdateObjectNode and UpdateLeafNode, and its subclass UpdateSetNode. Implement a function
Status UpdateObjectNode::parseAndMerge(modifiertable::ModifierType type, BSONElement modExpr, bool fromReplication, CollatorInterface* collator, bool* positional)
|
parseAndMerge() should parse modExpr as an update modifier and merge it with the UpdateObjectNode. This will be plugged into UpdateDriver::addAndParse().
Parsing should fail if:
- type is not MOD_SET (for now).
- The field path in modExpr is not updatable.
- The field path in modExpr contains multiple positional ($) elements, e.g. {$set: {"a.$.$": 5}}.
- A leaf node fails to parse the value, e.g. {$inc: {a: "bad"}}.
- A conflict is detected, i.e. we try to create an UpdateObjectNode and an UpdateLeafNode in the same position in the try, or we try to create two UpdateLeafNodes in the same position in the tree.
Implement UpdateNode::setCollator().
|