Uploaded image for project: 'Rust Driver'
  1. Rust Driver
  2. RUST-350

Finer-grained updates from aggregation via $merge

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      . h4. Description of Drivers Ticket:
      This stage will eventually replace the new modes of $out, but for now will be separate.

      The syntax will be:

      {$merge: {
        into: "collection name" OR {db: "db name", coll: "collection name"},
        on: <fields used to uniquely identify a document>,
        let: <optional, variables to be in scope for pipeline below>,
        whenMatched: "replace|keepExisting|fail|merge|pipeline",
        whenNotMatched: "insert|discard|fail"
      }}
      

      For this ticket, we will only support the combination of modes already supported by $out:
      mode "insertDocuments":

      {$merge: {
        into: "x",
        on: "x_id"
        whenMatched: "fail",
        whenNotMatched: "insert"
      }}
      

      mode "replaceDocuments":

      {$merge: {
        into: "x",
        on: "x_id"
        whenMatched: "replaceWithNew",
        whenNotMatched: "insert"
      }}
      

      In future tickets we'll add support for other modes.

      See DRIVERS-873 for updated details.

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: