DittoPendingIDSpecificOperation

class DittoPendingIDSpecificOperation

These objects are returned when using findByID functionality on DittoCollections. 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, will notify you every time there's an update to the document with the ID you provided in the preceding findByID 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 findByID call. Calling observe 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 observeLocal. Update and remove functionality is also exposed through this object. Update and remove functionality is also exposed through this object.

Functions

evict
Link copied to clipboard
fun evict(): Boolean
Evict the document with the matching ID.
exec
Link copied to clipboard
fun exec(): DittoDocument?
Execute the find operation to return the document with the matching ID.
observe
Link copied to clipboard
fun observe(eventHandler: (DittoDocument?, DittoSingleDocumentLiveQueryEvent) -> Unit): DittoLiveQuery
Enables you to listen for changes that occur in relation to a document.
fun observe(callback: DittoSingleDocumentLiveQueryCallback): DittoLiveQuery
Enables you to listen for changes that occur in relation to a document.
observeLocal
Link copied to clipboard
fun observeLocal(eventHandler: (DittoDocument?, DittoSingleDocumentLiveQueryEvent) -> Unit): DittoLiveQuery
Enables you to listen for changes that occur in relation to a document.
fun observeLocal(callback: DittoSingleDocumentLiveQueryCallback): DittoLiveQuery
Enables you to listen for changes that occur in relation to a document.
observeLocalWithNextSignal
Link copied to clipboard
Enables you to listen for changes that occur in relation to a document, and to signal when you are ready for the live query to deliver the next event.
Enables you to listen for changes that occur in relation to a document, and to signal when you are ready for the live query to deliver the next event.
observeWithNextSignal
Link copied to clipboard
Enables you to listen for changes that occur in relation to a document, and to signal when you are ready for the live query to deliver the next event.
Enables you to listen for changes that occur in relation to a document, and to signal when you are ready for the live query to deliver the next event.
remove
Link copied to clipboard
fun remove(): Boolean
Remove the document with the matching ID.
subscribe
Link copied to clipboard
fun subscribe(): DittoSubscription
Enables you to subscribe to changes that occur in relation to a document.
update
Link copied to clipboard
fun update(closure: (DittoMutableDocument?) -> Unit): List<DittoUpdateResult>
Update the document with the matching ID.
fun update(updater: DittoSingleMutableDocumentUpdater): List<DittoUpdateResult>
Update the document with the matching ID.

Properties

collectionName
Link copied to clipboard
val collectionName: String
the name of the collection that the operation will be performed on.
docID
Link copied to clipboard
val docID: DittoDocumentID
the ID of the document that the operation will be performed on.