ApplicationBatchSaver allows you to do basic configuration of batch saving:

  • set saved items,
  • save.

Type parameters

Hierarchy

Methods

all

  • all(): Promise<void>
  • The method runs a batch save.

    The app items defined by the ApplicationBatchSaveBuilder.items method are saved. The maximum number of items is 10000.

    await  Application.batch().save().items((function*(){
        for (var i = 0; i < 100;  i++) { 
            yield Application.create(); 
        } 
    })()).all(); 
    

    Returns Promise<void>

items

  • The method allows defining the saved items.

    Maximum 10000 items are allowed.

    Parameters

    • items: Iterable<ApplicationItem<T, P>>

      Items.

      Application.batch().save().items([Application.create() , Application.create()]);
      

      or

      Application.batch().save() .items((function*(){
          for (var i = 0; i < 100; i++) { 
              yield  Application.create(); 
          } 
      })()); 
      

    Returns ApplicationBatchSaver<T, P>

notify

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

    Parameters

    • enabled: boolean

      If enabled is set to true, notifications are enabled. By default, notifications are disabled. Important: enabling notifications when saving a large number of app items causes an excessive load onthe system. For each item, a stadard creation or update event is generated, which is then processed in the system in general order.

      const rows =  await Application.batch().save().items(items)
         .notify(true) 
         .all();  
      

    Returns this