Actions6
Overview
This node interacts with Firebase Firestore to perform various document operations such as querying collections, adding documents, updating, setting, getting, and deleting documents. It is useful for workflows that require reading from or writing to Firestore databases, for example, retrieving user data, updating order information, or querying documents with specific conditions.
Use Case Examples
- Query a Firestore collection with specific conditions and limits to retrieve filtered documents.
- Add a new document with auto-generated ID to a Firestore collection.
- Update an existing Firestore document by merging new data.
- Delete a Firestore document by specifying its path.
Properties
| Name | Meaning |
|---|---|
| Collection Path | The path to the Firestore collection to operate on, without a leading slash. Used in operations like addDocument, query, setDocument, and updateDocument. |
| Query Conditions | Conditions to filter the query results when querying a collection. Includes 'Where' clauses with field, operator, and value, and 'Order By' clauses with field and direction. |
| Limit | Maximum number of documents to return in a query operation. Must be at least 1. |
Output
JSON
exists- Boolean indicating if the document exists (for getDocument operation).id- Document ID in Firestore.path- Full path of the document or collection in Firestore.wrote- Boolean indicating successful write operation (setDocument).data- Data written or merged into the document.merged- Boolean indicating successful merge operation (updateDocument).deleted- Boolean indicating successful deletion of a document.error- Error message if an operation fails and continueOnFail is enabled.
Dependencies
- Firebase Admin SDK for Firestore
Troubleshooting
- Missing or malformed Firestore credentials will cause initialization errors. Ensure the service account private key is correctly formatted and pasted.
- Invalid collection or document paths will cause Firestore errors. Paths should not have leading slashes and must exist for get, update, or delete operations.
- Query conditions must be valid Firestore operators and values must be correctly typed (JSON parsing is attempted).
- If an operation fails and continueOnFail is disabled, the node will throw an error and stop execution.
Links
- Firebase Firestore Documentation - Official documentation for Firestore database usage and API.