Click or drag to resize

MergeStageWhenMatched Enumeration

The behavior of $merge is a result document and an existing document in the collection have the same value for the specified on field(s).

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.14.0+2b37a1fe1cbdbe1a020b52b77f1197b6d77575e7
Syntax
public enum MergeStageWhenMatched
Members
  Member nameValueDescription
Replace0 Replace the existing document in the output collection with the matching results document.
KeepExisting1 Keep the existing document in the output collection.
Merge2 Merge the matching documents (similar to the $mergeObjects operator).
Fail3 Stop and fail the aggregation. Any changes to the output collection from previous documents are not reverted.
Pipeline4 Use an aggregation pipeline to update the document in the collection.
See Also