DittoWriteTransaction
public class DittoWriteTransaction
DittoWriteTransaction
exposes functionality that allows you to perform multiple operations on the store
within a single write transaction. You must use the scoped
function to get collection-scoped access to the
write transaction object, which will then allow you to perform insert, update, remove or evict operations using the
write transaction.
-
Creates a
DittoScopedWriteTransaction
object that will ensure that operations called on it are all in the context of the collection name provided to this function. You can create manyDittoScopedWriteTransaction
objects perDittoWriteTransaction
object.Declaration
Swift
public func scoped(toCollectionNamed collectionName: String) -> DittoScopedWriteTransaction
Parameters
collectionName
The name of the collection that the write transaction object should be scoped to.
Return Value
A
DittoScopedWriteTransaction
that is scoped to the specified collection. -
Returns a
DittoScopedWriteTransaction
object that will ensure that operations called on it are all in the context of the collection name provided to this function. You can create manyDittoScopedWriteTransaction
objects perDittoWriteTransaction
object.Declaration
Swift
public subscript(collectionName: String) -> DittoScopedWriteTransaction { get }
Parameters
collectionName
The name of the collection that the write transaction object should be scoped to.
Return Value
A
DittoScopedWriteTransaction
that is scoped to the specified collection.