Class PartialUpdateBuilder<T>

Type Parameters

Hierarchy

Constructors

Properties

operations: UpdateOperation[] = []

Methods

  • Adds an item to a set

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    • item: any

      The item to add

    Returns PartialUpdateBuilder<T>

  • Private

    Adds an update operation on the partial update

    Returns

    Parameters

    • path: string

      The path which gets modified by the operation

    • operator: string

      The operator of the operation to add

    • Optional value: any

      The value used to execute the operation

    Returns PartialUpdateBuilder<T>

  • Private

    Adds initial operations

    Parameters

    Returns void

  • Performs a bitwise AND on a path

    Returns

    Parameters

    • path: string

      The path to perform the operation on

    • bitmask: number

      The bitmask taking part in the operation

    Returns PartialUpdateBuilder<T>

  • Sets the smallest possible value of a field

    Returns

    Parameters

    • field: string

      The field to compare with

    • value: number

      The smalles possible value

    Returns PartialUpdateBuilder<T>

  • Sets the highest possible value of a field

    Returns

    Parameters

    • field: string

      The field to compare with

    • value: number

      The highest possible value

    Returns PartialUpdateBuilder<T>

  • Sets a datetime field to the current moment

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    Returns PartialUpdateBuilder<T>

  • Decrements a field by a given value

    Returns

    Parameters

    • field: string

      The field to decrement

    • Optional by: number

      The number to decrement by, defaults to 1

    Returns PartialUpdateBuilder<T>

  • Decrements a field by a given value

    Returns

    Parameters

    • field: string

      The field to decrement

    • Optional by: number

      The number to decrement by, defaults to 1

    Returns PartialUpdateBuilder<T>

  • Divides a field by a given number

    Returns

    Parameters

    • field: string

      The field to divide

    • divisor: number

      The number to divide by

    Returns PartialUpdateBuilder<T>

  • Divides a field by a given number

    Returns

    Parameters

    • field: string

      The field to divide

    • divisor: number

      The number to divide by

    Returns PartialUpdateBuilder<T>

  • Executes the partial update

    Returns

    The promise resolves when the partial update has been executed successfully

    Abstract

    Returns Promise<T>

  • Private

    Checks whether an operation on the field exists already

    Returns

    True, if the operation does exist

    Parameters

    • path: string

      The path where the operation is executed on

    Returns boolean

  • Increments a field by a given value

    Returns

    Parameters

    • field: string

      The field to increment

    • Optional by: number

      The number to increment by, defaults to 1

    Returns PartialUpdateBuilder<T>

  • Increments a field by a given value

    Returns

    Parameters

    • field: string

      The field to increment

    • Optional by: number

      The number to increment by, defaults to 1

    Returns PartialUpdateBuilder<T>

  • Sets the smallest possible value of a field

    Returns

    Parameters

    • field: string

      The field to compare with

    • value: number

      The smalles possible value

    Returns PartialUpdateBuilder<T>

  • Sets the highest possible value of a field

    Returns

    Parameters

    • field: string

      The field to compare with

    • value: number

      The highest possible value

    Returns PartialUpdateBuilder<T>

  • Multiplies a field by a given number

    Returns

    Parameters

    • field: string

      The field to multiply

    • multiplicator: number

      The number to multiply by

    Returns PartialUpdateBuilder<T>

  • Multiplies a field by a given number

    Returns

    Parameters

    • field: string

      The field to multiply

    • multiplicator: number

      The number to multiply by

    Returns PartialUpdateBuilder<T>

  • Performs a bitwise OR on a path

    Returns

    Parameters

    • path: string

      The path to perform the operation on

    • bitmask: number

      The bitmask taking part in the operation

    Returns PartialUpdateBuilder<T>

  • Pops the last item out of a list

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    Returns PartialUpdateBuilder<T>

  • Pushes an item into a list

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    • item: any

      The item to add

    Returns PartialUpdateBuilder<T>

  • Puts an item from an array or map

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    • key: string | number | {
          [key: string]: any;
      }

      The map key to put the value to or an object of arguments

    • Optional value: any

      The value to put if a key was used

    Returns PartialUpdateBuilder<T>

  • Removes an item from an array or map

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    • item: any

      The item to add

    Returns PartialUpdateBuilder<T>

  • Renames a field

    Returns

    Parameters

    • oldPath: string

      The old field name

    • newPath: string

      The new field name

    Returns PartialUpdateBuilder<T>

  • Replaces an item at a given index

    Returns

    Parameters

    • path: string

      The path to perform the operation on

    • index: number

      The index where the item will be replaced

    • item: any

      The item to replace with

    Returns PartialUpdateBuilder<T>

  • Sets a field to a given value

    Returns

    Parameters

    • field: string

      The field to set

    • value: any

      The value to set to

    Returns PartialUpdateBuilder<T>

  • Shifts the first item out of a list

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    Returns PartialUpdateBuilder<T>

  • Returns a JSON representation of this partial update

    Returns

    Returns Json

  • Sets a datetime field to the current moment

    Method

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    Returns PartialUpdateBuilder<T>

  • Unshifts an item into a list

    Returns

    Parameters

    • field: string

      The field to perform the operation on

    • item: any

      The item to add

    Returns PartialUpdateBuilder<T>

  • Performs a bitwise XOR on a path

    Returns

    Parameters

    • path: string

      The path to perform the operation on

    • bitmask: number

      The bitmask taking part in the operation

    Returns PartialUpdateBuilder<T>

Generated using TypeDoc