DittoScopedWriteTransaction

class DittoScopedWriteTransaction(baseTransaction: DittoWriteTransaction, collectionName: String)

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

Constructors

DittoScopedWriteTransaction
Link copied to clipboard
fun DittoScopedWriteTransaction(baseTransaction: DittoWriteTransaction, collectionName: String)

Functions

find
Link copied to clipboard
fun find(query: String): DittoWriteTransactionPendingCursorOperation
fun find(query: String, queryArgs: Map<String, Any?>): DittoWriteTransactionPendingCursorOperation

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

findAll
Link copied to clipboard
fun findAll(): DittoWriteTransactionPendingCursorOperation

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

findByID
Link copied to clipboard

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

insert
Link copied to clipboard
fun <T : Any> insert(value: T, id: DittoDocumentID? = null, isDefault: Boolean = false): DittoDocumentID

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

insertWithStrategy
Link copied to clipboard
fun <T : Any> insertWithStrategy(value: T, id: DittoDocumentID? = null, writeStrategy: DittoWriteStrategy = DittoWriteStrategy.Overwrite): DittoDocumentID

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

upsert
Link copied to clipboard
fun <T : Any> upsert(value: T, writeStrategy: DittoWriteStrategy = DittoWriteStrategy.Merge): DittoDocumentID

Inserts a new document into the collection and returns its ID. If the document already exists, the behavior is determined by the given writeStrategy.

Properties

collectionName
Link copied to clipboard
val collectionName: String

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