Module spring.data.mongodb
Class ReplaceRootOperation.ReplaceRootOperationBuilder
java.lang.Object
org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation.ReplaceRootOperationBuilder
- Enclosing class:
- ReplaceRootOperation
Builder for
ReplaceRootOperation.- Author:
- Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDefines a root document replacement based on a composable document that is empty initially.withDocument(org.bson.Document document) Defines a root document replacement based on a composable document given document.withValueOf(String fieldName) Defines a root document replacement based on a fieldName that resolves to a document.withValueOf(AggregationExpression aggregationExpression) Defines a root document replacement based on aAggregationExpressionthat resolves to a document.
-
Constructor Details
-
ReplaceRootOperationBuilder
public ReplaceRootOperationBuilder()
-
-
Method Details
-
withValueOf
Defines a root document replacement based on a fieldName that resolves to a document.- Parameters:
fieldName- must not be null or empty.- Returns:
- the final
ReplaceRootOperation.
-
withValueOf
Defines a root document replacement based on aAggregationExpressionthat resolves to a document.- Parameters:
aggregationExpression- must not be null.- Returns:
- the final
ReplaceRootOperation.
-
withDocument
Defines a root document replacement based on a composable document that is empty initially.
ReplaceRootOperationcan be populated with individual entries and derive its values from other, existing documents.- Returns:
- the
ReplaceRootOperation.ReplaceRootDocumentOperation.
-
withDocument
Defines a root document replacement based on a composable document given document.
ReplaceRootOperationcan be populated with individual entries and derive its values from other, existing documents.- Parameters:
document- must not be null.- Returns:
- the final
ReplaceRootOperation.
-