Class MergeOperation.WhenDocumentsDontMatch
java.lang.Object
org.springframework.data.mongodb.core.aggregation.MergeOperation.WhenDocumentsDontMatch
- Enclosing class:
- MergeOperation
Value Object specifying how to deal with a result document that do not match an existing document in the collection
based on the fields of the
on
property describing the unique identifier.- Since:
- 2.3
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionDiscard the document - do not insert the document into the output collection.Stop and fail the aggregation operation.Insert the document into the output collection.org.bson.Document
toDocument
(AggregationOperationContext context) whenNotMatchedOf
(String value) Factory method creatingMergeOperation.WhenDocumentsDontMatch
from avalue
literal.
-
Method Details
-
whenNotMatchedOf
Factory method creatingMergeOperation.WhenDocumentsDontMatch
from avalue
literal.- Parameters:
value
- must not be null.- Returns:
- new instance of
MergeOperation.WhenDocumentsDontMatch
.
-
insertNewDocument
Insert the document into the output collection.- Returns:
- new instance of
MergeOperation.WhenDocumentsDontMatch
.
-
discardDocument
Discard the document - do not insert the document into the output collection.- Returns:
- new instance of
MergeOperation.WhenDocumentsDontMatch
.
-
failWhenNotMatch
Stop and fail the aggregation operation. Does not revert already performed changes on previous documents.- Returns:
- new instance of
MergeOperation.WhenDocumentsDontMatch
.
-
toDocument
-