ditto-lib / live.ditto / DittoScopedWriteTransaction

DittoScopedWriteTransaction

class DittoScopedWriteTransaction

DittoScopedWriteTransaction exposes functionality that allows you to perform multiple operations on the store within a single write transaction.

Constructors

<init>

DittoScopedWriteTransaction exposes functionality that allows you to perform multiple operations on the store within a single write transaction.

DittoScopedWriteTransaction(baseTransaction: DittoWriteTransaction, collectionName: String)

Properties

baseTransaction

val baseTransaction: DittoWriteTransaction

collectionName

the name of the collection that the scoped write transaction is scoped to.

val collectionName: String

Functions

find

Generates a DittoWriteTransactionPendingCursorOperation with the provided query that can be used to update, remove, or evict documents.

fun find(query: String): DittoWriteTransactionPendingCursorOperation

findAll

Generates a DittoWriteTransactionPendingCursorOperation that can be used to update, remove or evict documents.

fun findAll(): DittoWriteTransactionPendingCursorOperation

findByID

Generates a DittoWriteTransactionPendingIDSpecificOperation with the provided document ID that can be used to update, remove, or evict the document.

fun findByID(id: String): DittoWriteTransactionPendingIDSpecificOperation

insert

Inserts a document into the scoped collection and returns the document's ID.

fun <T : Any> insert(value: T, id: String? = null, isDefault: Boolean = false): String