Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Transaction

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

preconditions

preconditions: any

writes

writes: any[] = []

Methods

add

commit

  • commit(): Promise<undefined>
  • Commits the transaction. Will throw if the transaction failed.

    Returns Promise<undefined>

delete

get

  • get(refs: Array<Reference | string>): Promise<any>
  • Wraps batch get with additional functionality needed in transactions. Transactions need to be atomic. So in order to know that the document wasn't changed concurrently then we save the updateTime of each document.

    Later we tell the database to use that as a precondition for the write. In other words, if the update time of a document changed, then abort the transaction. However, if a document didn't exist, then we use that as a precondition, telling the database that if it was created concurrently then it should abort the operation.

    Parameters

    Returns Promise<any>

set

update

Legend

Generated using TypeDoc