ApplicationBatchUpdater allows you to do basic configuration of batch update:

  • set search criteria;
  • save.

Type parameters

Hierarchy

Methods

all

  • all(): Promise<number>
  • The method runs a batch update.

    Returns the number of items that were actually updated according to ApplicationBatchUpdater.size, starting from [[ApplicationBatchUpdater. from]]. By default, the size of the updated items is limited to 10 entries. If you need to update more items, use the ApplicationBatchUpdater.size method.

    const searchResults = await Application.update()
        .set('str', _ => 'test') 
        .where((f, g) => g.and ( 
            f. __deletedAt.eq(null), 
            f.str.eq(null) 
        )) 
        .all(); 
    

    Returns Promise<number>

from

  • from(n: number): this
  • The method allows skipping the set number of updated items.

    Parameters

    • n: number

    Returns this

notify

  • notify(enabled: boolean): this
  • The method sets notifications for when app items are updated.

    Parameters

    • enabled: boolean

    Returns this

set

  • set<K>(f: K, v: UpdateClosure<UpdatableItem<TFull>, RemoveIndex<T>[K]>): ApplicationBatchUpdater<TFull, Omit<RemoveIndex<T>, K>, P>
  • The method allows setting rules for updating fields of app items in a collection.

    Type parameters

    • K: keyof UpdatableItem<T>

    Parameters

    • f: K
    • v: UpdateClosure<UpdatableItem<TFull>, RemoveIndex<T>[K]>

    Returns ApplicationBatchUpdater<TFull, Omit<RemoveIndex<T>, K>, P>

size

  • size(n: number): this
  • The method allows to limit the number of updated items.

    Parameters

    • n: number

    Returns this

where

  • where(fc: FilterClosure<TFull>): this
  • The method allows setting filtering for updated app items in a collection.

    Parameters

    • fc: FilterClosure<TFull>

    Returns this