firestore-batch
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

firestore-batch

A Firestore batch with no document limit

Install

npm i firestore-batch

Import

const { Batch } = require('firestore-batch')
 
import Batch from 'firestore-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.
 */
constructor(firestoreany, 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.
 */
create(refany, dataRecord<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.
 */
set(refany, dataRecord<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.
 */
update(refany, dataRecord<string, any>)Batch
/**
 * Adds a `Delete` operation to this `Batch`.
 * 
 * @param ref The document reference you are deleting.
 * 
 * @returns This `Batch` instance.
 */
delete(ref: any): Batch
/**
 * 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>

Package Sidebar

Install

npm i firestore-batch

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

12.1 kB

Total Files

8

Last publish

Collaborators

  • kenmueller