Actions6
Overview
This node integrates with Firebase Firestore to perform various document operations such as adding, updating (merging), setting (creating/replacing), deleting, retrieving, and querying documents within Firestore collections. It is useful for automating Firestore data management tasks within workflows, such as updating user profiles, managing orders, or querying data based on conditions.
Use Case Examples
- Updating a user document with new profile information by merging new data into an existing Firestore document.
- Adding a new order document to a collection with an auto-generated ID.
- Querying a collection of products with specific filters and ordering.
Properties
| Name | Meaning |
|---|---|
| Collection Path | The Firestore collection path where the document or query operation will be performed. It should be specified without a leading slash. |
| Document Path | The Firestore document path to get, delete, set, or update. It should be specified without a leading slash. |
| Data | The JSON payload to write or merge into a Firestore document during set or update operations. |
Output
JSON
exists- Indicates if the document exists (boolean).id- The Firestore document ID.path- The full path of the document in Firestore.wrote- Indicates a successful write operation (boolean).merged- Indicates a successful merge update operation (boolean).deleted- Indicates a successful delete operation (boolean).data- The JSON data written or merged into the document.error- Error message if the operation failed and continueOnFail is enabled.
Dependencies
- Firebase Admin SDK
Troubleshooting
- Missing or malformed Firestore credentials will cause initialization errors. Ensure the service account private key is correctly formatted and pasted exactly as provided by Google, with proper newline characters.
- If a document path or collection path is incorrect or does not exist, operations like getDocument or deleteDocument may return 'document does not exist' or fail.
- JSON parsing errors may occur if the 'Data' input is not valid JSON.
- Errors during Firestore operations will be thrown unless 'continueOnFail' is enabled, in which case errors are returned in the output JSON under the 'error' key.
Links
- Firebase Firestore Documentation - Official documentation for Firebase Firestore, including usage and API references.