RealmResults

interface RealmResults<T : BaseRealmObject> : List<T> , Deleteable, Versioned

A Realm Result holds the results of querying the Realm.

See also

Functions

asFlow
Link copied to clipboard
abstract fun asFlow(): <ERROR CLASS><ResultsChange<T>>

Observe changes to the RealmResult. Once subscribed the flow will emit a InitialResults event and then a UpdatedResults on any change to the objects represented by the query backing the RealmResults. The flow will continue running indefinitely except if the results are from a backlinks property, then they will stop once the target object is deleted.

contains
Link copied to clipboard
abstract operator override fun contains(element: T): Boolean
containsAll
Link copied to clipboard
abstract override fun containsAll(elements: Collection<T>): Boolean
get
Link copied to clipboard
abstract operator fun get(index: Int): T
indexOf
Link copied to clipboard
abstract fun indexOf(element: T): Int
isEmpty
Link copied to clipboard
abstract override fun isEmpty(): Boolean
iterator
Link copied to clipboard
abstract operator override fun iterator(): Iterator<T>
lastIndexOf
Link copied to clipboard
abstract fun lastIndexOf(element: T): Int
listIterator
Link copied to clipboard
abstract fun listIterator(): ListIterator<T>
abstract fun listIterator(index: Int): ListIterator<T>
query
Link copied to clipboard
abstract fun query(query: String = TRUE_PREDICATE, vararg args: Any?): RealmQuery<T>

Perform a query on the objects of this result using the Realm Query Language.

subList
Link copied to clipboard
abstract fun subList(fromIndex: Int, toIndex: Int): List<T>
version
Link copied to clipboard
abstract fun version(): VersionId

Returns the Realm version of this object. This version number is tied to the transaction the object was read from.

Properties

size
Link copied to clipboard
abstract override val size: Int

Extensions

copyFromRealm
Link copied to clipboard
inline fun <T : TypedRealmObject> RealmResults<T>.copyFromRealm(depth: UInt = UInt.MAX_VALUE): List<T>

Makes an unmanaged in-memory copy of the elements in a RealmResults. This is a deep copy that will copy all referenced objects.