DittoStore
@objc
public class DittoStore : NSObject
DittoStore
provides access to DittoCollection
s and a write transaction API.
-
Returns a
DittoCollection
with the provided name.Throws
DittoKitError
if there is a storage backend error.Declaration
Swift
@objc public func collection(name: String) throws -> DittoCollection
Parameters
name
The name of the collection.
Return Value
-
Returns a list of the names of collections in the store.
Throws
DittoKitError
if there is a storage backend error.Declaration
Swift
@objc public func collectionNames() throws -> [String]
Return Value
A list of collection names found in the store.
-
Allows you to group multiple operations together that affect multiple documents, potentially across multiple collections.
Throws
DittoKitError
if there is a storage backend error.Declaration
Swift
public func write( _ block: (DittoWriteTransaction) -> Void ) throws -> [DittoWriteTransactionResult]
Parameters
block
A closure that provides access to a write transaction object that can be used to perform operations on the store.
Return Value
A list of
DittoWriteTransactionResult
s. There is a result for each operation performed as part of the write transaction.