Module spring.data.mongodb
Class ReplaceRootOperation.ReplaceRootDocumentOperation
java.lang.Object
org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation
org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation.ReplaceRootDocumentOperation
- All Implemented Interfaces:
AggregationOperation,FieldsExposingAggregationOperation
- Enclosing class:
- ReplaceRootOperation
Encapsulates the aggregation framework
Instances of
$replaceRoot-operation to result in a composable replacement
document. Instances of
ReplaceRootOperation.ReplaceRootDocumentOperation yield empty upon construction and can be populated with single
values and documents.- Author:
- Mark Paluch
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation
ReplaceRootOperation.Replacement, ReplaceRootOperation.ReplaceRootDocumentOperation, ReplaceRootOperation.ReplaceRootDocumentOperationBuilder, ReplaceRootOperation.ReplaceRootOperationBuilderNested classes/interfaces inherited from interface org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregationOperation
FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates an emptyReplaceRootOperation.ReplaceRootDocumentOperation.protectedReplaceRootDocumentOperation(ReplaceRootOperation.ReplaceRootDocumentOperation currentOperation, org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation.ReplacementDocument extension) Creates an extendedReplaceRootOperation.ReplaceRootDocumentOperationthat combinesReplaceRootOperation.ReplacementDocuments from the currentOperation and extension operation. -
Method Summary
Modifier and TypeMethodDescriptionand(AggregationExpression aggregationExpression) Creates a newReplaceRootOperation.ReplaceRootDocumentOperationBuilderto define a field for theAggregationExpression.Creates a newReplaceRootOperation.ReplaceRootDocumentOperationBuilderto define a field for the value.andValuesOf(Object value) Creates a newReplaceRootOperation.ReplaceRootDocumentOperationthat merges all existing replacement values with values from value.Methods inherited from class org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation
builder, getFields, getOperator, getReplacement, toDocumentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.mongodb.core.aggregation.AggregationOperation
toPipelineStagesMethods inherited from interface org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregationOperation
inheritsFields
-
Constructor Details
-
ReplaceRootDocumentOperation
public ReplaceRootDocumentOperation()Creates an emptyReplaceRootOperation.ReplaceRootDocumentOperation. -
ReplaceRootDocumentOperation
protected ReplaceRootDocumentOperation(ReplaceRootOperation.ReplaceRootDocumentOperation currentOperation, org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation.ReplacementDocument extension) Creates an extendedReplaceRootOperation.ReplaceRootDocumentOperationthat combinesReplaceRootOperation.ReplacementDocuments from the currentOperation and extension operation.- Parameters:
currentOperation- must not be null.extension- must not be null.
-
-
Method Details
-
and
public ReplaceRootOperation.ReplaceRootDocumentOperationBuilder and(AggregationExpression aggregationExpression) Creates a newReplaceRootOperation.ReplaceRootDocumentOperationBuilderto define a field for theAggregationExpression.- Parameters:
aggregationExpression- must not be null.- Returns:
- the
ReplaceRootOperation.ReplaceRootDocumentOperationBuilder.
-
andValue
Creates a newReplaceRootOperation.ReplaceRootDocumentOperationBuilderto define a field for the value.- Parameters:
value- must not be null.- Returns:
- the
ReplaceRootOperation.ReplaceRootDocumentOperationBuilder.
-
andValuesOf
Creates a newReplaceRootOperation.ReplaceRootDocumentOperationthat merges all existing replacement values with values from value. Existing replacement values are overwritten.- Parameters:
value- must not be null.- Returns:
- the
ReplaceRootOperation.ReplaceRootDocumentOperation.
-