Adding and Editing Data
-
Exposes functionality that allows you to perform multiple operations on the store within a single write transaction.
You must use the
See morescopedmethod 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.Declaration
Objective-C
@interface DITWriteTransaction : NSObject -
Defines the various strategies available when inserting a document into a collection.
See moreDeclaration
Objective-C
enum DITWriteStrategy : NSUInteger {} -
Exposes functionality that allows you to perform multiple operations on the store within a single write transaction.
A
See moreDITScopedWriteTransactionis scoped to a specific collection, obtained by callingscopedon aDITWriteTransaction.Declaration
Objective-C
@interface DITScopedWriteTransaction : NSObject -
These objects are returned when using
findandfindAllfunctionality onDITScopedWriteTransactions.You can use them to perform updates on documents and remove or evict documents.
See moreDeclaration
Objective-C
@interface DITWriteTransactionPendingCursorOperation : NSObject -
These objects are returned when using
findByIDfunctionality onDITScopedWriteTransactions.You can use them to perform updates on a document and remove or evict a document.
See moreDeclaration
Objective-C
@interface DITWriteTransactionPendingIDSpecificOperation : NSObject -
These objects are returned when calling
collectionsonDITStore.They allow chaining of further collections-related functions. You can either call
execon the object to get an array ofDITCollections as an immediate return value, or you can establish either a live query or a subscription, which both work over time.A live query, established by calling
observeLocal, will notify you every time there’s a change in the collections that the device knows about.A subscription, established by calling
subscribe, will act as a signal to other peers that you would like to receive updates from them about the collections that they know about.Typically, an app would set up a
subscribein some part of the application which is long-lived to ensure the device receives updates from the mesh. These updates will be automatically received and written into the local store. Elsewhere, where you need to use this data, anobserveLocalcan be used to notify you of the data, and all subsequent changes to the data.If you want to observe changes in such a way that you can signal when you’re ready for the live query to deliver a new update then you can call
See moreobserveLocalWithNextSignal.Declaration
Objective-C
@interface DITPendingCollectionsOperation : NSObject -
Provides information about a successful update operation on a document.
The update result can be one of the following types:
setremovedincremented
Declaration
Objective-C
@interface DITUpdateResult : NSObject -
The types of update result.
See moreDeclaration
Objective-C
enum DITUpdateResultType : NSUInteger {} -
Provides information about the result of an operation on a document that was part of a write transaction.
The write transaction result can be one of the following types:
insertedremovedevictedupdated
Declaration
Objective-C
@interface DITWriteTransactionResult : NSObject -
The types of write transaction results.
See moreDeclaration
Objective-C
enum DITWriteTransactionResultType : NSUInteger {}
Adding and Editing Data Reference