dittosynckit / live.ditto / DittoWriteTransactionPendingCursorOperation / update

update

fun update(closure: (List<DittoMutableDocument>) -> Unit): Map<String, List<DittoUpdateResult>>

Update documents that match the query generated by the preceding function chaining.

Parameters

closure - a closure that gets called with all of the documents matching the query. The documents are DittoMutableDocuments so you can call update-related functions on them.

Return
a dictionary of document IDs to lists of DittoUpdateResult that describes the updates that were performed for each document.

fun update(updater: DittoMutableDocumentsUpdater): Map<String, List<DittoUpdateResult>>

Update documents that match the query generated by the preceding function chaining.

Parameters

updater - an object that implements DittoMutableDocumentsUpdater, whose update function gets called with all of the documents matching the query. The documents are DittoMutableDocuments so you can call update-related functions on them.

Return
a dictionary of document IDs to lists of DittoUpdateResult that describes the updates that were performed for each document.