Sets the field that act as a unique identifier for a document.
Sets the field that act as a unique identifier for a document. The identifier determine if a results document matches an already existing document in the output collection.
the unique identifier(s)
this
Sets the variables accessible for use in the whenMatched pipeline.
Sets the variables accessible for use in the whenMatched pipeline.
the variables
this
Sets the behavior of $merge if a result document and an existing document in the collection have the same value for the specified on field(s).
Sets the behavior of $merge if a result document and an existing document in the collection have the same value for the specified on field(s).
when matched
this
Sets aggregation pipeline to update the document in the collection.
Sets aggregation pipeline to update the document in the collection.
when matched pipeline
this
WhenMatched#PIPELINE
Sets the behavior of $merge if a result document does not match an existing document in the out collection.
Sets the behavior of $merge if a result document does not match an existing document in the out collection.
when not matched
this
Options to control the behavior of the
$merge
aggregation stage2.7