ditto-lib / live.ditto / DittoStore / write

write

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

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

Parameters

block - a closure that provides access to a write transaction object that can be used to perform operations on the store.

Return
a list of DittoWriteTransactionResults. There is a result for each operation performed as part of the write transaction.

fun write(handler: DittoWriteTransactionHandler): List<DittoWriteTransactionResult>

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

Parameters

handler - an object that implements the DittoWriteTransactionHandler interface, whose write function will be provided with a write transaction object that can be used to perform operations on the store.

Return
a list of DittoWriteTransactionResults. There is a result for each operation performed as part of the write transaction.