Class TransactionAttemptContext

Provides an interface to preform transactional operations in a transaction.

Hierarchy

  • TransactionAttemptContext

Methods

  • Retrieves the value of a document from the collection.

    Parameters

    • collection: Collection

      The collection the document lives in.

    • key: string

      The document key to retrieve.

    Returns Promise<TransactionGetResult>

  • Inserts a new document to the collection, failing if the document already exists.

    Parameters

    • collection: Collection

      The collection the document lives in.

    • key: string

      The document key to insert.

    • content: any

      The document content to insert.

    Returns Promise<TransactionGetResult>

  • Executes a query in the context of this transaction.

    Type Parameters

    • TRow = any

    Parameters

    • statement: string

      The statement to execute.

    • Optional options: TransactionQueryOptions

      Optional parameters for this operation.

    Returns Promise<TransactionQueryResult<TRow>>

  • Removes a document from a collection.

    Parameters

    Returns Promise<void>

Generated using TypeDoc