sort

open fun sort(block: SortOptionDsl<Document>.() -> Unit)(source)

The order in which documents should be returned.

Example

collection.find(
options = {
ascending(User::age)
},
filter = {
User::age.exists()
}
)

External resources