Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-28621

Parse BSON update expression into an UpdateNode tree

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.7
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • Query 2017-04-17, Query 2017-05-08

      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().

            Assignee:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Reporter:
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: