Actions6
Overview
This node integrates with Firebase Firestore to perform various document operations such as adding, deleting, retrieving, updating, and querying documents within Firestore collections. It is useful for automating workflows that require interaction with Firestore databases, such as managing user data, orders, or any structured data stored in Firestore. For example, it can add a new document with an auto-generated ID to a specified collection, update existing documents by merging new data, or query collections with specific conditions and ordering.
Use Case Examples
- Adding a new user document to a 'users' collection with auto-generated ID.
- Updating an existing order document with new status information.
- Querying a collection of products with filters and sorting by price.
Properties
| Name | Meaning |
|---|---|
| Collection Path | The path to the Firestore collection where the document will be added. It should be specified without a leading slash, e.g., 'users' or 'users/123/orders'. This property is required for the addDocument operation. |
| Data | The JSON payload representing the document data to write or merge into Firestore. This is used when adding, setting, or updating documents. |
Output
JSON
id- The auto-generated document ID assigned by Firestore when adding a new document.path- The full path to the document in Firestore, combining the collection path and document ID.
- Fields of the document data as stored in Firestore, dynamically included based on the input data.
Dependencies
- Requires Firebase Admin SDK for Firestore access.
- Needs Firestore service account credentials including project ID, client email, and private key.
Troubleshooting
- Ensure Firestore credentials are correctly configured and the private key is properly formatted (escaped newlines handled).
- Common errors include authentication failures due to malformed private keys or missing credentials.
- If the node throws errors related to document paths or collection paths, verify that the paths are correctly specified without leading slashes.
- When using JSON data input, ensure the JSON is valid and properly structured.
Links
- Firebase Firestore Documentation - Official documentation for Firestore, useful for understanding Firestore concepts and data structure.