RealmScalarQuery

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.

Inheritors

Functions

Link copied to clipboard
abstract fun asFlow(): Flow<T>

Calculates the value that fulfills the query conditions and returns it asynchronously as a Flow.

Link copied to clipboard
abstract fun find(): T

Returns the value of a scalar query as a T in a blocking fashion. The result may be of a different type depending on the type of query:

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