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(baseTransaction: DittoWriteTransaction, collectionName: String)

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

Properties

baseTransaction

val baseTransaction: DittoWriteTransaction

collectionName

val collectionName: String

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

Functions

find

fun find(query: String): DittoWriteTransactionPendingCursorOperation

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

findAll

fun findAll(): DittoWriteTransactionPendingCursorOperation

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

findByID

fun findByID(id: String): DittoWriteTransactionPendingIDSpecificOperation

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

insert

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

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