Sort

mongo4cats.operations.Sort
See theSort companion object
trait Sort

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

fieldName

the field name

Returns:

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