Package com.mongodb.client.model
Class Sorts
- java.lang.Object
-
- com.mongodb.client.model.Sorts
-
@Deprecated(since="2021-05-27") public final class Sorts extends java.lang.Object
Deprecated.Usage of this API is not supported in AEM as a Cloud Service.A factory for sort specifications. A convenient way to use this class is to statically import all of its methods, which allows usage like:collection.find().sort(orderBy(ascending("x", "y"), descending("z")))
- Since:
- 3.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Bson
ascending(java.lang.String... fieldNames)
Deprecated.Create a sort specification for an ascending sort on the given fields.static Bson
ascending(java.util.List<java.lang.String> fieldNames)
Deprecated.Create a sort specification for an ascending sort on the given fields.static Bson
descending(java.lang.String... fieldNames)
Deprecated.Create a sort specification for a descending sort on the given fields.static Bson
descending(java.util.List<java.lang.String> fieldNames)
Deprecated.Create a sort specification for a descending sort on the given fields.static Bson
metaTextScore(java.lang.String fieldName)
Deprecated.Create a sort specification for the text score meta projection on the given field.static Bson
orderBy(java.util.List<? extends Bson> sorts)
Deprecated.Combine multiple sort specifications.static Bson
orderBy(Bson... sorts)
Deprecated.Combine multiple sort specifications.
-
-
-
Method Detail
-
ascending
public static Bson ascending(java.lang.String... fieldNames)
Deprecated.Create a sort specification for an ascending sort on the given fields.- Parameters:
fieldNames
- the field names, which must contain at least one- Returns:
- the sort specification
-
ascending
public static Bson ascending(java.util.List<java.lang.String> fieldNames)
Deprecated.Create a sort specification for an ascending sort on the given fields.- Parameters:
fieldNames
- the field names, which must contain at least one- Returns:
- the sort specification
-
descending
public static Bson descending(java.lang.String... fieldNames)
Deprecated.Create a sort specification for a descending sort on the given fields.- Parameters:
fieldNames
- the field names, which must contain at least one- Returns:
- the sort specification
-
descending
public static Bson descending(java.util.List<java.lang.String> fieldNames)
Deprecated.Create a sort specification for a descending sort on the given fields.- Parameters:
fieldNames
- the field names, which must contain at least one- Returns:
- the sort specification
-
metaTextScore
public static Bson metaTextScore(java.lang.String fieldName)
Deprecated.Create a sort specification for the text score meta projection on the given field.- Parameters:
fieldName
- the field name- Returns:
- the sort specification
-
orderBy
public static Bson orderBy(Bson... sorts)
Deprecated.Combine multiple sort specifications. If any field names are repeated, the last one takes precedence.- Parameters:
sorts
- the sort specifications- Returns:
- the combined sort specification
-
-