DittoWriteTransactionPendingIDSpecificOperation

@objc
public class DittoWriteTransactionPendingIDSpecificOperation : NSObject, DocumentInstructing

These objects are returned when using findByID functionality on DittoScopedWriteTransactions. You can use them to perform updates on a document and remove or evcit a document.

  • Remove the document with the matching ID.

    Throws

    DittoKitError

    Declaration

    Swift

    @objc
    public func remove() throws
  • Evict the document with the matching ID.

    Throws

    DittoKitError

    Declaration

    Swift

    @objc
    public func evict() throws
  • Update the document with the matching ID.

    Throws

    DittoKitError

    Declaration

    Swift

    @discardableResult
    public func update(
        _ closure: (DittoMutableDocument?) -> Void
    ) throws -> [DittoUpdateResult]

    Parameters

    closure

    A 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 be nil.

    Return Value

    A list of DittoUpdateResults that describes the updates that were performed on the document.

  • Update the document with the matching ID.

    Throws

    DittoKitError

    Declaration

    Swift

    public func update<T>(using newValue: T) throws where T : Decodable, T : Encodable

    Parameters

    using

    An object representing the desired new state of the document’s value.