Before you get started, you must add the FirebaseTS library to your project. Follow this tutorial to learn how to add FirebaseTS.
Before you get started, you must add the FirebaseTS library to your project. Follow this tutorial to learn how to add FirebaseTS.
Once you have added FirebaseTS, you are set to go!
Batch Operations
In this section, we will be executing multiple Cloud Firestore operations using the all() method from the FirebaseTSFirestore Class.
Here is the definition of the all() method:
The operations property is an array that stores a collection of operation objects call BatchOperation.
Create BatchOperation
new BatchOperation (
Update BatchOperation
new BatchOperation (
Delete BatchOperation
new BatchOperation (
How to Use
1. Import the FirebaseTSFirestore class.
import { FirebaseTSFirestore } from 'firebasets/firebasetsFirestore/firebaseTSFirestore';
2. Declare and initialize a FirebaseTSFirestore object.
3. Call the all() method and add all the batch operations.
this.firestore.all(
Handling code on complete or fail
Sometimes you may want to do something when you have successfully or unsuccessfully execute all the operations, like a notification message. You can add the optional parameters onComplete and onFail.