public final class Sorts
extends java.lang.Object
collection.find().sort(orderBy(ascending("x", "y"), descending("z")))
Modifier and Type | Method and Description |
---|---|
static Bson |
ascending(java.util.List<java.lang.String> fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
ascending(java.lang.String... fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
descending(java.util.List<java.lang.String> fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
descending(java.lang.String... fieldNames)
Create a sort specification for an ascending sort on the given fields.
|
static Bson |
metaTextScore(java.lang.String fieldName)
Create a sort specification for the text score meta projection on the given field.
|
static Bson |
orderBy(Bson... sorts)
Combine multiple sort specifications.
|
static Bson |
orderBy(java.util.List<? extends Bson> sorts)
Combine multiple sort specifications.
|
public static Bson ascending(java.lang.String... fieldNames)
fieldNames
- the field names, which must contain at least onepublic static Bson ascending(java.util.List<java.lang.String> fieldNames)
fieldNames
- the field names, which must contain at least onepublic static Bson descending(java.lang.String... fieldNames)
fieldNames
- the field names, which must contain at least onepublic static Bson descending(java.util.List<java.lang.String> fieldNames)
fieldNames
- the field names, which must contain at least onepublic static Bson metaTextScore(java.lang.String fieldName)
fieldName
- the field namepublic static Bson orderBy(Bson... sorts)
sorts
- the sort specifications