Class Sort
- java.lang.Object
-
- dev.morphia.aggregation.experimental.stages.Stage
-
- dev.morphia.aggregation.experimental.stages.Sort
-
public class Sort extends Stage
Sorts all input documents and returns them to the pipeline in sorted order.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sort.Direction
The sort typesclass
Sort.SortType
-
Constructor Summary
Constructors Modifier Constructor Description protected
Sort()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Sort
ascending(String field, String... additional)
Adds an ascending sort definition on the field.Sort
descending(String field, String... additional)
Adds an descending sort definition on the field.List<Sort.SortType>
getSorts()
Sort
meta(String field)
Adds a sort by the computed textScore metadata in descending order.static Sort
on()
Creates a sort stage.-
Methods inherited from class dev.morphia.aggregation.experimental.stages.Stage
getStageName
-
-
-
-
Method Detail
-
on
public static Sort on()
Creates a sort stage.- Returns:
- the new stage
-
ascending
public Sort ascending(String field, String... additional)
Adds an ascending sort definition on the field.- Parameters:
field
- the sort fieldadditional
- any additional fields to sort on- Returns:
- this
-
descending
public Sort descending(String field, String... additional)
Adds an descending sort definition on the field.- Parameters:
field
- the sort fieldadditional
- any additional fields to sort on- Returns:
- this
-
getSorts
public List<Sort.SortType> getSorts()
- Returns:
- the sorts
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-