Module spring.data.mongodb
Class SetWindowFieldsOperation
java.lang.Object
org.springframework.data.mongodb.core.aggregation.SetWindowFieldsOperation
- All Implemented Interfaces:
AggregationOperation,FieldsExposingAggregationOperation,FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
public class SetWindowFieldsOperation
extends Object
implements AggregationOperation, FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
Encapsulates the
setWindowFields-operation.- Since:
- 3.3
- Author:
- Christoph Strobl
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAFieldthat the result of a computation done via anAggregationExpression.static classSetWindowFieldsOperation.Windowimplementation based on the current document.static classBuilder API for aSetWindowFieldsOperation.RangeWindow.static classSetWindowFieldsOperation.Windowimplementation based on the sort fields.static classBuilder API for aSetWindowFieldsOperation.RangeWindow.static classA fluent builder to create aSetWindowFieldsOperation.static interfaceASetWindowFieldsOperation.Windowto be used forComputedField.static classSetWindowFieldsOperation.WindowOutputdefines output of $setWindowFields stage by defining thefield(s)to append to the documents in the output.static interfacestatic interfaceThe actual time unit to apply to aSetWindowFieldsOperation.Window.static enumQuick access to availableunits.Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregationOperation
FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSetWindowFieldsOperation(Object partitionBy, AggregationOperation sortBy, SetWindowFieldsOperation.WindowOutput output) Create a newSetWindowFieldsOperationwith given args. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Obtain abuilderto create aSetWindowFieldsOperation.Returns the fields exposed by theAggregationOperation.Return the MongoDB operator that is used for thisAggregationOperation.org.bson.DocumenttoDocument(AggregationOperationContext context) Methods 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.InheritsFieldsAggregationOperation
inheritsFields
-
Constructor Details
-
SetWindowFieldsOperation
protected SetWindowFieldsOperation(@Nullable Object partitionBy, @Nullable AggregationOperation sortBy, SetWindowFieldsOperation.WindowOutput output) Create a newSetWindowFieldsOperationwith given args.- Parameters:
partitionBy- The field orAggregationExpressionto group by.sortBy- theoperationto sort the documents by in the partition.output- theSetWindowFieldsOperation.WindowOutputcontaining the fields to add and the rules to calculate their respective values.
-
-
Method Details
-
builder
Obtain abuilderto create aSetWindowFieldsOperation.- Returns:
- new instance of
SetWindowFieldsOperation.SetWindowFieldsOperationBuilder.
-
getFields
Description copied from interface:FieldsExposingAggregationOperationReturns the fields exposed by theAggregationOperation.- Specified by:
getFieldsin interfaceFieldsExposingAggregationOperation- Returns:
- will never be null.
-
toDocument
Description copied from interface:AggregationOperation- Specified by:
toDocumentin interfaceAggregationOperation- Parameters:
context- theAggregationOperationContextto operate within. Must not be null.- Returns:
- the Document
-
getOperator
Description copied from interface:AggregationOperationReturn the MongoDB operator that is used for thisAggregationOperation. Aggregation operations should implement this method to avoid document rendering.- Specified by:
getOperatorin interfaceAggregationOperation- Returns:
- the operator used for this
AggregationOperation.
-