SortOptionDsl

DSL to describe a sort order.

This DSL declares the methods ascending and descending which describe in which order elements are sorted.

For example,

ascending(User::name)
descending(User::age)

will sort users in alphabetical order of their name, and when users have the same name, will sort them in decreasing order of their age.

See WithSort.sort.

Properties

Link copied to clipboard
abstract val context: <Error class: unknown class>

The context used to generate this expression.

Link copied to clipboard

Converts a Kotlin property into a Field.

Functions

Link copied to clipboard
abstract override fun accept(node: BsonNode)

Adds a new node as a child of this one.

Link copied to clipboard
fun <N : Node> CompoundNode<N>.acceptAll(nodes: Iterable<N>)

Adds any number of nodes into this one.

Link copied to clipboard
open fun ascending(field: KProperty1<Document, *>)
abstract fun ascending(field: Field<Document, *>)

If two documents have a different value of field, the one with lesser value will be returned first.

Link copied to clipboard
open fun descending(field: KProperty1<Document, *>)
abstract fun descending(field: Field<Document, *>)

If two documents have a different value of field, the one with greater value will be returned first.

Link copied to clipboard
open operator fun <Root, Parent, Child> KProperty1<Root, Parent>.div(child: KProperty1<Parent & Any, Child>): Field<Root, Child>

Refers to child as a nested field of the current field.

Link copied to clipboard
abstract override fun freeze()

Makes this expression immutable.

Link copied to clipboard
open operator fun <Root, Type> KProperty1<Root, Collection<Type>>.get(index: Int): Field<Root, Type>

Refers to a specific item in an array, by its index.

open operator fun <Root, Type> KProperty1<Root, Map<String, Type>>.get(index: String): Field<Root, Type>

Refers to a specific item in a map, by its name.

Link copied to clipboard
abstract fun simplify(): BsonNode?

Returns a simplified (but equivalent) expression to the current expression.

Link copied to clipboard
open fun toBson(): <Error class: unknown class>

Writes the result of simplifying to a new Bson.

Link copied to clipboard
abstract override fun toString(): String

JSON representation of this expression.

Link copied to clipboard
abstract fun writeTo(writer: <Error class: unknown class>)

Writes the result of simplifying this expression into writer.