DITWriteTransactionPendingIDSpecificOperation

@interface DITWriteTransactionPendingIDSpecificOperation : NSObject

These objects are returned when using findByID functionality on DITScopedWriteTransactions.

You can use them to perform updates on a document and remove or evict a document.

  • Execute the find operation to return the document with the matching ID.

    Declaration

    Objective-C

    - (DITDocument *_Nullable)exec;

    Return Value

    The DITDocument with the ID provided in the findByID call or nil if the document was not found.

  • Remove the document with the matching ID.

    Declaration

    Objective-C

    - (BOOL)remove;

    Return Value

    true if the document was found and removed. false if the document wasn’t found and therefore wasn’t removed.

  • Evict the document with the matching ID.

    Declaration

    Objective-C

    - (BOOL)evict;

    Return Value

    true if the document was found and evicted. false if the document wasn’t found and therefore wasn’t evicted.

  • Update the document with the matching ID.

    Declaration

    Objective-C

    - (nonnull NSArray<DITUpdateResult *> *)updateWithBlock:
        (nonnull void (^)(DITMutableDocument *_Nullable))block;

    Parameters

    block

    A block that gets called with the document matching the ID. If found, the document is a DITMutableDocument, so you can call update-related functions on it. If the document is not found then the value provided to the block will be nil.

    Return Value

    A list of DITUpdateResults that describe the updates that were performed on the document.