Package dev.morphia.aggregation.stages
Class SortByCount
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.SortByCount
Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SortByCount
sortByCount
(Object expression) Creates a new stage grouping by the given expression.
-
Method Details
-
sortByCount
Creates a new stage grouping by the given expression.- Parameters:
expression
- the expression- Returns:
- this
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $sortByCount
- Since server release
- 3.4
-