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.ReplaceRootOperationBuilder
Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregationOperation
FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
-
Constructor Summary
ModifierConstructorDescriptionCreates an emptyReplaceRootOperation.ReplaceRootDocumentOperation
.protected
ReplaceRootDocumentOperation
(ReplaceRootOperation.ReplaceRootDocumentOperation currentOperation, org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation.ReplacementDocument extension) Creates an extendedReplaceRootOperation.ReplaceRootDocumentOperation
that combinesReplaceRootOperation.ReplacementDocument
s from the currentOperation and extension operation. -
Method Summary
Modifier and TypeMethodDescriptionand
(AggregationExpression aggregationExpression) Creates a newReplaceRootOperation.ReplaceRootDocumentOperationBuilder
to define a field for theAggregationExpression
.Creates a newReplaceRootOperation.ReplaceRootDocumentOperationBuilder
to define a field for the value.andValuesOf
(Object value) Creates a newReplaceRootOperation.ReplaceRootDocumentOperation
that merges all existing replacement values with values from value.Methods inherited from class org.springframework.data.mongodb.core.aggregation.ReplaceRootOperation
builder, getFields, getOperator, getReplacement, toDocument
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.mongodb.core.aggregation.AggregationOperation
toPipelineStages
Methods 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.ReplaceRootDocumentOperation
that combinesReplaceRootOperation.ReplacementDocument
s 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.ReplaceRootDocumentOperationBuilder
to define a field for theAggregationExpression
.- Parameters:
aggregationExpression
- must not be null.- Returns:
- the
ReplaceRootOperation.ReplaceRootDocumentOperationBuilder
.
-
andValue
Creates a newReplaceRootOperation.ReplaceRootDocumentOperationBuilder
to define a field for the value.- Parameters:
value
- must not be null.- Returns:
- the
ReplaceRootOperation.ReplaceRootDocumentOperationBuilder
.
-
andValuesOf
Creates a newReplaceRootOperation.ReplaceRootDocumentOperation
that merges all existing replacement values with values from value. Existing replacement values are overwritten.- Parameters:
value
- must not be null.- Returns:
- the
ReplaceRootOperation.ReplaceRootDocumentOperation
.
-