Module spring.data.mongodb
Class SetWindowFieldsOperation.SetWindowFieldsOperationBuilder
java.lang.Object
org.springframework.data.mongodb.core.aggregation.SetWindowFieldsOperation.SetWindowFieldsOperationBuilder
- Enclosing class:
- SetWindowFieldsOperation
A fluent builder to create a
SetWindowFieldsOperation.- Author:
- Christoph Strobl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface to capture field name used to capture the computation result.static interfaceInterface to capture an optionalSetWindowFieldsOperation.Windowapplicable to the field computation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Obtain a new instance ofSetWindowFieldsOperationwith previously set arguments.output(AggregationExpression expression) Add a field capturing the result of the givenexpressionto the output.Define the actual output computation.partitionBy(Object value) Partition by a value that translates to a valid mongodb expression.partitionByExpression(AggregationExpression expression) Specify theexpressionto group by.partitionByField(String fieldName) Specify the field to group by.Sortascendingby the given fields.Set the sort order.sortBy(SortOperation sort) Set theSortOperationto use.
-
Constructor Details
-
SetWindowFieldsOperationBuilder
public SetWindowFieldsOperationBuilder()
-
-
Method Details
-
partitionByField
Specify the field to group by.- Parameters:
fieldName- must not be null or null.- Returns:
- this.
-
partitionByExpression
public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder partitionByExpression(AggregationExpression expression) Specify theexpressionto group by.- Parameters:
expression- must not be null.- Returns:
- this.
-
sortBy
Sortascendingby the given fields.- Parameters:
fields- must not be null.- Returns:
- this.
-
sortBy
Set the sort order.- Parameters:
sort- must not be null.- Returns:
- this.
-
sortBy
Set theSortOperationto use.- Parameters:
sort- must not be null.- Returns:
- this.
-
output
public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder output(SetWindowFieldsOperation.WindowOutput output) Define the actual output computation.- Parameters:
output- must not be null.- Returns:
- this.
-
output
public SetWindowFieldsOperation.SetWindowFieldsOperationBuilder.WindowChoice output(AggregationExpression expression) Add a field capturing the result of the givenexpressionto the output.- Parameters:
expression- must not be null.- Returns:
- new instance of
SetWindowFieldsOperation.SetWindowFieldsOperationBuilder.WindowChoice.
-
partitionBy
Partition by a value that translates to a valid mongodb expression.- Parameters:
value- must not be null.- Returns:
- this.
-
build
Obtain a new instance ofSetWindowFieldsOperationwith previously set arguments.- Returns:
- new instance of
SetWindowFieldsOperation.
-