-
Type: Improvement
-
Resolution: Won't Do
-
Priority: 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.
- is depended on by
-
DRIVERS-671 Finer-grained updates from aggregation via $merge
- Closed