Sort

trait Sort
Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def asc(fieldNames: String*): Sort

Create a sort specification for an ascending sort on the given field.

Create a sort specification for an ascending sort on the given field.

Value Params
fieldNames

the field name

Returns

the sort specification https://docs.mongodb.com/manual/reference/method/cursor.sort/#std-label-sort-asc-desc

def combinedWith(anotherSort: Sort): Sort

Combine multiple sort specifications. If any field names are repeated, the last one takes precedence.

Combine multiple sort specifications. If any field names are repeated, the last one takes precedence.

Value Params
anotherSort

the sort specifications

Returns

the combined sort specification

def desc(fieldNames: String*): Sort

Create a sort specification for a descending sort on the given field.

Create a sort specification for a descending sort on the given field.

Value Params
fieldNames

the field name

Returns

the sort specification https://docs.mongodb.com/manual/reference/method/cursor.sort/#std-label-sort-asc-desc

def metaTextScore(fieldName: String): Sort

Create a sort specification for the text score meta projection on the given field.

Create a sort specification for the text score meta projection on the given field.

Value Params
fieldName

the field name

Returns

the sort specification https://docs.mongodb.com/manual/reference/method/cursor.sort/#std-label-sort-metadata