Options
All
  • Public
  • Public/Protected
  • All
Menu

ReadTransaction performs a read-only bulk transaction on the underlying store.

Hierarchy

  • Transaction<ReadTransactionRequest, ReadTransactionReply>
    • ReadTransaction

Index

Constructors

Methods

Constructors

constructor

  • new ReadTransaction(config: Config, client: Client<ReadTransactionRequest, ReadTransactionReply>, dbID: Buffer, modelName: string): ReadTransaction

Methods

end

  • end(): Promise<void>
  • end completes (flushes) the transaction. All operations between start and end will be applied as a single transaction upon a call to end.

    Returns Promise<void>

find

  • find queries the store for entities matching the given query parameters. See Query for options.

    Type parameters

    • T

    Parameters

    • query: QueryJSON

      The object that describes the query. See Query for options. Alternatively, see QueryJSON for the basic interface.

    Returns Promise<InstanceList<T>>

findByID

  • findByID<T>(ID: string): Promise<Instance<T>>
  • findByID queries the store for the id of an instance.

    Type parameters

    • T

    Parameters

    • ID: string

      The id of the instance to search for.

    Returns Promise<Instance<T>>

has

  • has(IDs: string[]): Promise<boolean>
  • has checks whether a given instance exists in the given store.

    Parameters

    • IDs: string[]

      An array of instance ids to check for.

    Returns Promise<boolean>

start

  • start(): Promise<void>
  • start begins the transaction. All operations between start and end will be applied as a single transaction upon a call to end.

    Returns Promise<void>