Ditto 1.1.8
|
These objects are returned when using DittoCollection.FindById(string) functionality. More...
Public Member Functions | |
unsafe DittoDocument | Exec () |
Execute the find operation to return the document with the matching ID. More... | |
unsafe bool | Remove () |
Remove the document with the matching ID. More... | |
unsafe bool | Evict () |
Evict the document with the matching ID. More... | |
unsafe List< DittoUpdateResult > | Update (Action< DittoMutableDocument > updater) |
Update the document with the matching ID. More... | |
DittoSubscription | Subscribe () |
Enables you to subscribe to changes that occur in relation to a document remotely. More... | |
DittoLiveQuery | Observe (Action< DittoDocument, DittoSingleDocumentLiveQueryEvent > handler) |
Enables you to listen for changes that occur in relation to a document locally and remotely. More... | |
DittoLiveQuery | ObserveLocal (Action< DittoDocument, DittoSingleDocumentLiveQueryEvent > handler) |
Enables you to listen for changes that occur in relation to a document locally. More... | |
DittoLiveQuery | ObserveWithNextSignal (Action< DittoDocument, DittoSingleDocumentLiveQueryEvent, Action > handler) |
Enables you to listen for changes that occur in relation to a document locally and remotely, and to signal when you are ready for the live query to deliver the next event. More... | |
DittoLiveQuery | ObserveLocalWithNextSignal (Action< DittoDocument, DittoSingleDocumentLiveQueryEvent, Action > handler) |
Enables you to listen for changes that occur in relation to a document locally, and to signal when you are ready for the live query to deliver the next event. More... | |
Properties | |
string | Query [get] |
Gets the query associated with this DittoPendingIDSpecificOperation . | |
These objects are returned when using DittoCollection.FindById(string) functionality.
You can either call Exec on the object to get 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 Observe(Action<DittoDocument, DittoSingleDocumentLiveQueryEvent>), will notify you every time there's an update to the document with the ID you provided in the preceding DittoCollection.FindById(string) call.
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 document with the ID you provided in the preceding DittoCollection.FindById(string) call.
Calling Observe(Action<DittoDocument, DittoSingleDocumentLiveQueryEvent>) will generate both a subscription and a live query at the same time.
If you'd like to only observe local changes then you can call DittoPendingIDSpecificOperation.ObserveLocal(Action<DittoDocument, DittoSingleDocumentLiveQueryEvent>).
Update, remove, and evict functionality is also exposed through this object.
|
inline |
Evict the document with the matching ID.
true
if the document was found and evicted. false
if the document wasn't found and therefore wasn't evicted.
|
inline |
Execute the find operation to return the document with the matching ID.
null
if the document was not found.
|
inline |
Enables you to listen for changes that occur in relation to a document locally and remotely.
The handler
block will be called when local or remote changes are made to the document referenced by the DittoCollection.FindById(string) call that precedes the call to Observe
.
The returned DittoLiveQuery object must be kept in scope for as long as you want the provided handler
to be called when an update occurs.
handler | A block that will be called every time there is a transaction committed to the store that involves a modification to the document with the relevant ID in the collection that Observe was called on. |
|
inline |
Enables you to listen for changes that occur in relation to a document locally.
This won't subscribe to receive changes made remotely by others and so it will only fire updates when a local change is made. If you want to receive remotely performed updates as well then use Observe(Action<DittoDocument, DittoSingleDocumentLiveQueryEvent>) or also call Subscribe separately, using another DittoCollection.FindById(string) call that references the same document ID.
The returned DittoLiveQuery object must be kept in scope for as long as you want the provided handler
to be called when an update occurs.
handler | A block that will be called every time there is a transaction committed to the store that involves a modification to the document with the relevant ID in the collection that ObserveLocal was called on. |
|
inline |
Enables you to listen for changes that occur in relation to a document locally, and to signal when you are ready for the live query to deliver the next event.
This won't subscribe to receive changes made remotely by others and so it will only fire updates when a local change is made. If you want to receive remotely performed updates as well then use ObserveWithNextSignal(Action<DittoDocument, DittoSingleDocumentLiveQueryEvent, Action>) or also call Subscribe separately, using another DittoCollection.FindById(string) call that references the same document ID.
The returned DittoLiveQuery object must be kept in scope for as long as you want the provided handler
to be called when an update occurs.
handler | A block that will be called every time there is a transaction committed to the store that involves a modification to the document with the relevant ID in the collection that ObserveLocal was called on. |
|
inline |
Enables you to listen for changes that occur in relation to a document locally and remotely, and to signal when you are ready for the live query to deliver the next event.
The handler
block will be called when local or remote changes are made to the document referenced by the DittoCollection.FindById(string) call that precedes the call to Observe
.
The returned DittoLiveQuery object must be kept in scope for as long as you want the provided handler
to be called when an update occurs.
handler | A block that will be called every time there is a transaction committed to the store that involves a modification to the document with the relevant ID in the collection that Observe was called on. |
|
inline |
Remove the document with the matching ID.
true
if the document was found and removed. false
if the document wasn't found and therefore wasn't removed.
|
inline |
Enables you to subscribe to changes that occur in relation to a document remotely.
Having a subscription acts as a signal to other peers that you are interested in receiving updates when local or remote changes are made to the relevant document.
The returned DittoSubscription object must be kept in scope for as long as you want to keep receiving updates.
|
inline |
Update the document with the matching ID.
updater | An Action that gets called with the document matching the ID. If found, the document is a DittoMutableDocument, so you can call update-related functions on it. If the document is not found then the value provided to the action will be nil . |