Package dev.morphia.aggregation.stages
Class Sort
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.Sort
Sorts all input documents and returns them to the pipeline in sorted order.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds an ascending sort definition on the field.descending
(String field, String... additional) Adds a descending sort definition on the field.Adds a sort by the computed textScore metadata in descending order.static Sort
sort()
Creates a sort stage.
-
Method Details
-
sort
Creates a sort stage.- Returns:
- the new stage
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $sort
-
ascending
Adds an ascending sort definition on the field.- Parameters:
field
- the sort fieldadditional
- any additional fields to sort on- Returns:
- this
-
descending
Adds a descending sort definition on the field.- Parameters:
field
- the sort fieldadditional
- any additional fields to sort on- Returns:
- this
-
meta
Adds a sort by the computed textScore metadata in descending order.- Parameters:
field
- the sort field- Returns:
- this
-