Package io.realm.kotlin.query

Types

RealmElementQuery
Link copied to clipboard
interface RealmElementQuery<T : BaseRealmObject> : Deleteable

Query returning RealmResults.

RealmQuery
Link copied to clipboard
interface RealmQuery<T : BaseRealmObject> : RealmElementQuery<T>

A RealmQuery encapsulates a query on a Realm, a RealmResults or a RealmList instance using the Builder pattern. The query is executed using either find or subscribing to the Flow returned by asFlow.

RealmResults
Link copied to clipboard
interface RealmResults<T : BaseRealmObject> : List<T> , Deleteable, Versioned

A Realm Result holds the results of querying the Realm.

RealmScalarNullableQuery
Link copied to clipboard
interface RealmScalarNullableQuery<T> : RealmScalarQuery<T?>

Queries that return scalar, nullable values. This type of query is used to more accurately represent the results provided by some query operations, e.g. RealmQuery.min or RealmQuery.max.

RealmScalarQuery
Link copied to clipboard
interface RealmScalarQuery<T>

Queries that return scalar values. This type of query is used to more accurately represent the results provided by some query operations, e.g. RealmQuery.count or RealmQuery.sum.

RealmSingleQuery
Link copied to clipboard
interface RealmSingleQuery<T : BaseRealmObject> : Deleteable

Query returning a single RealmObject or EmbeddedRealmObject.

Sort
Link copied to clipboard
enum Sort : Enum<Sort>

This enum describes the sorting order used in Realm queries.

Functions

find
Link copied to clipboard
fun <T : BaseRealmObject, R> RealmQuery<T>.find(block: (RealmResults<T>) -> R): R

Similar to RealmQuery.find but it receives a block in which the RealmResults from the query are provided.

fun <T, R> RealmScalarNullableQuery<T>.find(block: (T?) -> R): R

Similar to RealmScalarNullableQuery.find but it receives a block in which the scalar result from the query is provided.

fun <T, R> RealmScalarQuery<T>.find(block: (T) -> R): R

Similar to RealmScalarQuery.find but it receives a block in which the scalar result from the query is provided.

fun <T : BaseRealmObject, R> RealmSingleQuery<T>.find(block: (T?) -> R): R

Similar to RealmSingleQuery.find but it receives a block in which the RealmObject or EmbeddedRealmObject from the query is provided.

max
Link copied to clipboard
inline fun <T : Any> RealmQuery<*>.max(property: String): RealmScalarNullableQuery<T>

Similar to RealmQuery.max but the type parameter is automatically inferred.

min
Link copied to clipboard
inline fun <T : Any> RealmQuery<*>.min(property: String): RealmScalarNullableQuery<T>

Similar to RealmQuery.min but the type parameter is automatically inferred.

sum
Link copied to clipboard
inline fun <T : Any> RealmQuery<*>.sum(property: String): RealmScalarQuery<T>

Similar to RealmQuery.sum but the type parameter is automatically inferred.

Properties

TRUE_PREDICATE
Link copied to clipboard
const val TRUE_PREDICATE: String

A query filter predicate string that will be true for all objects, hence will make the query select all objects.