ditto-lib / live.ditto / DittoCollection / find

find

fun find(query: String): DittoPendingCursorOperation<Map<String, Any>>

Generates a DittoPendingCursorOperation with the provided query that can be used to find the documents matching the query at a point in time or you can chain a call to observe, observeLocal, or subscribe if you want to get updates about documents matching the query as they occur.

Parameters

query - the query to run against the collection.

Return
a DittoPendingCursorOperation that you can use to chain further query-related function calls.

fun <T : Any> find(query: String, clazz: KClass<T>): DittoPendingCursorOperation<T>
fun <T : Any> find(query: String, clazz: Class<T>): DittoPendingCursorOperation<T>

Generates a DittoPendingCursorOperation with the provided query that can be used to find the documents matching the query at a point in time or you can chain a call to observe, observeLocal, or subscribe if you want to get updates about documents matching the query as they occur.

Parameters

query - the query to run against the collection.

clazz - the class you want to be used when decoding the documents' inner values.

Return
a DittoPendingCursorOperation that you can use to chain further query-related function calls.

fun <T : Any> find(query: String, typeRef: TypeReference<T>): DittoPendingCursorOperation<T>

Generates a DittoPendingCursorOperation with the provided query that can be used to find the documents matching the query at a point in time or you can chain a call to observe, observeLocal, or subscribe if you want to get updates about documents matching the query as they occur.

Parameters

query - the query to run against the collection.

typeRef - the TypeReference you want to be used when decoding the documents' inner values.

Return
a DittoPendingCursorOperation that you can use to chain further query-related function calls.