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
Modifier and TypeClassDescriptionstatic class
AField
that the result of a computation done via anAggregationExpression
.static class
SetWindowFieldsOperation.Window
implementation based on the current document.static class
Builder API for aSetWindowFieldsOperation.RangeWindow
.static class
SetWindowFieldsOperation.Window
implementation based on the sort fields.static class
Builder API for aSetWindowFieldsOperation.RangeWindow
.static class
A fluent builder to create aSetWindowFieldsOperation
.static interface
ASetWindowFieldsOperation.Window
to be used forComputedField
.static class
SetWindowFieldsOperation.WindowOutput
defines output of $setWindowFields stage by defining thefield(s)
to append to the documents in the output.static interface
static interface
The actual time unit to apply to aSetWindowFieldsOperation.Window
.static enum
Quick access to availableunits
.Nested classes/interfaces inherited from interface org.springframework.data.mongodb.core.aggregation.FieldsExposingAggregationOperation
FieldsExposingAggregationOperation.InheritsFieldsAggregationOperation
-
Constructor Summary
ModifierConstructorDescriptionprotected
SetWindowFieldsOperation
(Object partitionBy, AggregationOperation sortBy, SetWindowFieldsOperation.WindowOutput output) Create a newSetWindowFieldsOperation
with given args. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Obtain abuilder
to create aSetWindowFieldsOperation
.Returns the fields exposed by theAggregationOperation
.Return the MongoDB operator that is used for thisAggregationOperation
.org.bson.Document
toDocument
(AggregationOperationContext context) 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.InheritsFieldsAggregationOperation
inheritsFields
-
Constructor Details
-
SetWindowFieldsOperation
protected SetWindowFieldsOperation(@Nullable Object partitionBy, @Nullable AggregationOperation sortBy, SetWindowFieldsOperation.WindowOutput output) Create a newSetWindowFieldsOperation
with given args.- Parameters:
partitionBy
- The field orAggregationExpression
to group by.sortBy
- theoperation
to sort the documents by in the partition.output
- theSetWindowFieldsOperation.WindowOutput
containing the fields to add and the rules to calculate their respective values.
-
-
Method Details
-
builder
Obtain abuilder
to create aSetWindowFieldsOperation
.- Returns:
- new instance of
SetWindowFieldsOperation.SetWindowFieldsOperationBuilder
.
-
getFields
Description copied from interface:FieldsExposingAggregationOperation
Returns the fields exposed by theAggregationOperation
.- Specified by:
getFields
in interfaceFieldsExposingAggregationOperation
- Returns:
- will never be null.
-
toDocument
Description copied from interface:AggregationOperation
- Specified by:
toDocument
in interfaceAggregationOperation
- Parameters:
context
- theAggregationOperationContext
to operate within. Must not be null.- Returns:
- the Document
-
getOperator
Description copied from interface:AggregationOperation
Return the MongoDB operator that is used for thisAggregationOperation
. Aggregation operations should implement this method to avoid document rendering.- Specified by:
getOperator
in interfaceAggregationOperation
- Returns:
- the operator used for this
AggregationOperation
.
-