For this task we just want to translate tests of modes "insertDocuments" and "replaceDocuments". Don't worry about removing duplicate coverage, that will be done by SERVER-41197.
Written as |
|
Translates to |
{$out: {
|
to: "x",
|
uniqueKey: \{x_id: 1},
|
mode: "insertDocuments"
|
}}
|
|
⟶ |
{$merge: {
|
into: "x",
|
on: "x_id"
|
whenMatched: "fail",
|
whenNotMatched: "insert"
|
}}
|
|
{$out: {
|
to: "x",
|
uniqueKey: \{x_id: 1},
|
mode: "replaceDocuments"
|
}}
|
|
⟶ |
{$merge: {
|
into: "x",
|
on: "x_id",
|
whenMatched: "replaceWithNew",
|
whenNotMatched: "insert"
|
}}
|
|