RealmSingleQuery

interface RealmSingleQuery<T : BaseRealmObject> : Deleteable

Query returning a single RealmObject or EmbeddedRealmObject.

Functions

asFlow
Link copied to clipboard
abstract fun asFlow(): Flow<SingleQueryChange<T>>
Observes changes to the first object that fulfills the query conditions.
find
Link copied to clipboard
abstract fun find(): T?
Finds the first object that fulfills the query conditions and returns it in a blocking fashion.

Extensions

find
Link copied to clipboard
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.