Overview
This node interacts with Firestore for the Joga+ app, allowing users to perform CRUD operations on Firestore collections. It supports adding, updating, deleting, and retrieving documents, as well as a specialized operation to get groups within a draw window based on a reference date. This node is useful for managing Firestore data dynamically within n8n workflows, such as adding new records, updating existing ones, or querying specific data ranges.
Use Case Examples
- Add a new document to a Firestore collection to store user data.
- Update an existing document in Firestore with new information.
- Delete a document from a Firestore collection by its ID.
- Retrieve all documents from a specified Firestore collection for processing or analysis.
Properties
| Name | Meaning |
|---|---|
| Collection | The Firestore collection to interact with. |
| Reference Date (ISO) | An ISO date-time string used as a reference for the 'Get Groups In Draw Window' operation. If empty, the current time is used. |
| Document ID | The ID of the document to update or delete. Optional for add operation. |
| Data (JSON) | The JSON data to write or update in the Firestore document. |
Output
JSON
id- The ID of the Firestore document.- ``
*
* `` - The data fields of the Firestore document.
updated- Indicates a document was updated (present only for update operation).deleted- Indicates a document was deleted (present only for delete operation).groupId- ID of the group in 'Get Groups In Draw Window' operation.groupid- ID of the group document.*
* `` - Data fields of the group document.
matchId- ID of the match document within a group.matchid- ID of the match document.*
* `` - Data fields of the match document.
windowstart- Start time of the draw window in ISO format.end- End time of the draw window in ISO format.lockMinutes- Number of minutes before the draw window locks.
Dependencies
- Firebase Admin SDK
Troubleshooting
- Ensure Firebase credentials are correctly configured and valid, including project ID, client email, and private key.
- Verify the 'collection' parameter is correctly specified and exists in Firestore.
- For update and delete operations, ensure the 'Document ID' is provided and corresponds to an existing document.
- When using 'Get Groups In Draw Window', provide a valid ISO date-time string for 'Reference Date (ISO)'; otherwise, the current time is used.
- Common error: 'Invalid referenceDate' indicates the provided date string is not a valid ISO format. Correct the input to resolve this.
Links
- Firestore Documentation - Official Firestore documentation for understanding Firestore concepts and API.
- Firebase Admin SDK Setup - Guide to setting up Firebase Admin SDK, which this node uses to interact with Firestore.