ditto-lib / live.ditto / DittoStore

DittoStore

class DittoStore

Provides access to DittoCollections and a write transaction API.

Functions

collection

Returns a DittoCollection with the provided name.

fun collection(name: String): DittoCollection

collectionNames

Returns a list of the names of collections in the store.

fun collectionNames(): List<String>

queriesHash

Returns a hash representing the current version of the given queries. When a document matching such queries gets mutated, the hash will change as well.

fun queriesHash(queries: Array<DittoLiveQuery>): BigInteger

queriesHashMnemonic

Returns a sequence of English words representing the current version of the given queries. When a document matching such queries gets mutated, the words will change as well.

fun queriesHashMnemonic(queries: Array<DittoLiveQuery>): String

write

Allows you to group multiple operations together that affect multiple documents, potentially across multiple collections.

fun write(block: (DittoWriteTransaction) -> Unit): List<DittoWriteTransactionResult>
fun write(handler: DittoWriteTransactionHandler): List<DittoWriteTransactionResult>