Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Interfaces

Functions

Functions

batch

  • Creates batch API with a set of functions (set, update, remove) that are similar to regular set, update and remove with the only difference that the batch counterparts do not return a promise and perform operations only when commit function is called.

    import { batch, collection } from 'typesaurus'
    
    type Counter = { count: number }
    const counters = collection<Counter>('counters')
    
    const { set, update, remove, commit } = batch()
    
    for (let count = 0; count < 500; count++) {
      // Each batch can be up to 500 set, update and remove operations
      set(counters, count.toString(), { count })
    }
    
    // Set 500 documents
    commit().then(() => console.log('Done!'))

    Returns Batch

    The batch API object.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc