DittoWriteTransactionPendingIDSpecificOperation
public class DittoWriteTransactionPendingIDSpecificOperation
These objects are returned when using findByID functionality on DittoScopedWriteTransactions.
You can use them to perform updates on a document and remove or evict a document.
-
Remove the document with the matching ID.
Declaration
Swift
@discardableResult public func remove() -> BoolReturn Value
trueif the document was found and removed.falseif the document wasn’t found and therefore wasn’t removed. -
Evict the document with the matching ID.
Declaration
Swift
@discardableResult public func evict() -> BoolReturn Value
trueif the document was found and evicted.falseif the document wasn’t found and therefore wasn’t evicted. -
Execute the find operation to return the document with the matching ID.
Declaration
Swift
public func exec() -> DittoDocument?Return Value
The
DittoDocumentwith the ID provided in thefindByIDcall ornilif the document was not found. -
Update the document with the matching ID.
Declaration
Swift
@discardableResult public func update( _ closure: @escaping (DittoMutableDocument?) -> Void ) -> [DittoUpdateResult]Parameters
closureA closure 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 closure will benil.Return Value
A list of
DittoUpdateResults that describes the updates that were performed on the document. -
Update the document with the matching ID.
Throws
DittoSwiftError.Declaration
Swift
@available(*, deprecated, message: "Codable APIs will be removed in the future.") public func update<T>(using newValue: T) throws where T : Decodable, T : EncodableParameters
usingAn object representing the desired new state of the document’s value.