firestore-batch
A Firestore batch with no document limit
Install
npm i firestore-batch
Import
const Batch =
Docs
/** * Create a new `Batch`. * * @param firestore The firestore admin instance that has already been initialized. * @param operations Initialize this batch with some operations. This is not necessary. */constructorfirestore: any, operations?: BatchOperation
/** * Adds a `Create` operation to this `Batch`. * * @param ref The document reference you are creating. * @param data The data to be inserted into the document. * * @returns This `Batch` instance. */createref: any, data: Record<string, any>: Batch
/** * Adds a `Set` operation to this `Batch`. * * @param ref The document reference you are setting. * @param data The data to be inserted into the document. * * @returns This `Batch` instance. */setref: any, data: Record<string, any>: Batch
/** * Adds an `Update` operation to this `Batch`. * * @param ref The document reference you are updating. * @param data The data to be inserted into the document. * * @returns This `Batch` instance. */updateref: any, data: Record<string, any>: Batch
/** * Adds a `Delete` operation to this `Batch`. * * @param ref The document reference you are deleting. * * @returns This `Batch` instance. */delete
/** * Executes all of the operations on this `Batch`. * No changes will take effect if this method is not called. * * @returns A new `Promise`. */commit: Promise<void>