Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BatchedDeleteOperation<T>

This operation deletes a list of objects from the database.

Usage

See deleteBatched.

Type parameters

  • T: Model<T>

    The model of the Datastore. T must extend from Model.

Hierarchy

  • BatchedDeleteOperation

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private _identifiers

_identifiers: string[] = []

Identifiers of objects to delete.

Private _store

_store: Datastore<T>

The datastore where the operation takes place.

Methods

delete

  • delete(): Promise<void>

id

  • id(id: string): this
  • Add the identifier of a single object to the deletion list.

    Parameters

    • id: string

      Identifier of an object to delete.

    Returns this

    Returns this operation again, to make chaining methods possible.

identifiers

  • identifiers(ids: string[]): this
  • Add an array of identifiers to the deletion list. Same as ids.

    Parameters

    • ids: string[]

      Array of identifiers to delete.

    Returns this

    Returns this operation again, to make chaining methods possible.

ids

  • ids(ids: string[]): this
  • Add an array of identifiers to the deletion list.

    Parameters

    • ids: string[]

      Array of identifiers to delete.

    Returns this

    Returns this operation again, to make chaining methods possible.

item

  • item(item: T): this
  • Add a single item to the deletion list.

    Parameters

    • item: T

      An item to delete.

    Returns this

    Returns this operation again, to make chaining methods possible.

items

  • items(items: T[]): this
  • Add an array of items to the deletion list.

    Parameters

    • items: T[]

      Array of items to delete.

    Returns this

    Returns this operation again, to make chaining methods possible.

run

  • run(): Promise<void>
  • Runs the operation. Deletes all the objects from the list.

    throws

    If one of the identifiers does not exist or something happened with the database.

    Returns Promise<void>

Generated using TypeDoc