Package dev.morphia.aggregation.stages
Class SetWindowFields
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.SetWindowFields
Performs operations on a specified span of documents in a collection, known as a window, and returns the results based on the chosen
window operator.
- Since:
- 2.3
- Since server release
- 5.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Specifies the field(s) to append to the documents in the output returned by the $setWindowFields stage.static class
Specifies the window boundaries and parameters. -
Method Summary
Modifier and TypeMethodDescriptionoutput
(SetWindowFields.Output... outputs) Specifies the field(s) to append to the documents in the output returned by the $setWindowFields stage.partitionBy
(Object partition) Defines the expression to use to partition the data.static SetWindowFields
Performs operations on a specified span of documents in a collection, known as a window, and returns the results based on the chosen window operator.Specifies the field(s) to sort the documents by in the partition.
-
Method Details
-
setWindowFields
Performs operations on a specified span of documents in a collection, known as a window, and returns the results based on the chosen window operator.- Returns:
- the new stage
- Since:
- 2.3
- MongoDB documentation
- Aggregration Pipeline Stage: $setWindowFields
- Since server release
- 5.0
-
output
Specifies the field(s) to append to the documents in the output returned by the $setWindowFields stage.- Parameters:
outputs
- the output fields- Returns:
- this
-
partitionBy
Defines the expression to use to partition the data.- Parameters:
partition
- the expression- Returns:
- this
-
sortBy
Specifies the field(s) to sort the documents by in the partition.- Parameters:
sorts
- the sort criteria- Returns:
- this
-