ditto-lib / live.ditto / DittoCollection / findByID

findByID

fun findByID(id: String): DittoPendingIDSpecificOperation<Map<String, Any>>

Generates a DittoPendingIDSpecificOperation with the provided document ID that can be used to find the document at a point in time or you can chain a call to observe, observeLocal, or subscribe if you want to get updates about the document over time.

Parameters

id - the ID of the document.

Return
a DittoPendingIDSpecificOperation that you can chain function calls to either get the document immediately or get updates about it over time.

fun <T : Any> findByID(id: String, clazz: KClass<T>): DittoPendingIDSpecificOperation<T>
fun <T : Any> findByID(id: String, clazz: Class<T>): DittoPendingIDSpecificOperation<T>

Generates a DittoPendingIDSpecificOperation with the provided document ID that can be used to find the document at a point in time or you can chain a call to observe, observeLocal, or subscribe if you want to get updates about the document over time.

Parameters

id - the ID of the document.

clazz - the class you want to be used when decoding the document's inner value.

Return
a DittoPendingIDSpecificOperation that you can chain function calls to either get the document immediately or get updates about it over time.

fun <T : Any> findByID(id: String, typeRef: TypeReference<T>): DittoPendingIDSpecificOperation<T>

Generates a DittoPendingIDSpecificOperation with the provided document ID that can be used to find the document at a point in time or you can chain a call to observe, observeLocal, or subscribe if you want to get updates about the document over time.

Parameters

id - the ID of the document.

typeRef - the TypeReference you want to be used when decoding the document's inner value.

Return
a DittoPendingIDSpecificOperation that you can chain function calls to either get the document immediately or get updates about it over time.