Class BasePendingIDSpecificOperationAbstract

These objects are returned when using findByID() functionality on collections.

You can either call exec() on the object to get an immediate return value, or chain calls to update, evict or remove the document.

Live queries and subscriptions are only available outside of a transaction.

Hierarchy

Implements

Properties

The collection the receiver is operating on.

documentID: DocumentID

The ID of the document this operation operates on.

Methods

  • Evicts the document with the matching ID.

    Returns Promise<boolean>

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

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

    Returns Promise<Document>

    The Document promise with the ID provided in the findByID() call or undefined if the document was not found.

  • Removes the document with the matching ID.

    Returns Promise<boolean>

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

  • Updates the document with the matching ID.

    Parameters

    • closure: ((document) => void)

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

    Returns Promise<UpdateResult[]>

    An array promise of update results that describe the updates that were performed on the document.