Packages

object Sorts

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

1.0

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Sorts
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def ascending(fieldNames: String*): Bson

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

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

    fieldNames

    the field names, which must contain at least one

    returns

    the sort specification

    See also

    Sort

  2. def descending(fieldNames: String*): Bson

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

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

    fieldNames

    the field names, which must contain at least one

    returns

    the sort specification

    See also

    Sort

  3. def metaTextScore(fieldName: String): Bson

    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.

    fieldName

    the field name

    returns

    the sort specification

    See also

    Filters.text(String, TextSearchOptions)

    textScore

  4. def orderBy(sorts: Bson*): Bson

    Combine multiple sort specifications.

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

    sorts

    the sort specifications

    returns

    the combined sort specification