sort

abstract fun sort(property: String, sortOrder: Sort = Sort.ASCENDING): RealmQuery<T>

Sorts the query result by the specific property name according to sortOrder, which is Sort.ASCENDING by default.

Sorting is currently limited to character sets in 'Latin Basic', 'Latin Supplement', 'Latin Extended A', and 'Latin Extended B' (UTF-8 range 0-591). For other character sets sorting will have no effect.

Parameters

property

the property name to sort by.

Throws

if the property name does not exist.

abstract fun sort(propertyAndSortOrder: Pair<String, Sort>, vararg additionalPropertiesAndOrders: Pair<String, Sort>): RealmQuery<T>

Sorts the query result by the specific property name according to Pairs of properties and sorting order.

Sorting is currently limited to character sets in 'Latin Basic', 'Latin Supplement', 'Latin Extended A', and 'Latin Extended B' (UTF-8 range 0-591). For other character sets sorting will have no effect.

Parameters

propertyAndSortOrder

pair containing the property and the order to sort by.

Throws

if the property name does not exist.