Overview
This node interacts with Firestore for the Joga+ app, allowing users to perform CRUD operations on Firestore collections. It supports getting documents, adding new documents, updating existing documents, deleting documents, and retrieving groups within a specific draw window based on a reference date. This node is useful for managing Firestore data dynamically within n8n workflows, such as updating user data, managing game groups, or scheduling matches.
Use Case Examples
- Deleting a document from a Firestore collection by specifying the collection name and document ID.
- Retrieving groups and their scheduled matches within a time window defined by a reference date, useful for scheduling or event management.
- Adding or updating documents in Firestore collections to keep data synchronized with external systems.
Properties
| Name | Meaning |
|---|---|
| Collection | The Firestore collection to operate on. |
| 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 other operations. |
| Data (JSON) | The JSON data to write or update in the document. |
Output
JSON
id- The ID of the document affected or retrieved.deleted- Boolean flag indicating if the document was deleted (present only for delete operation).updated- Boolean flag indicating if the document was updated (present only for update operation).groupId- ID of the group (for 'Get Groups In Draw Window' operation).groupid- ID of the group document.
- Other fields of the group document.matchId- ID of the match document within the group.matchid- ID of the match document.
- Other 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 the Firebase credentials are correctly configured and have the necessary permissions to access Firestore.
- For the 'Delete Document' operation, the Document ID must be provided; otherwise, the operation will fail.
- When using 'Get Groups In Draw Window', the Reference Date must be a valid ISO date-time string; invalid formats will cause errors.
- Network issues or Firestore service outages can cause operation failures; verify connectivity and Firestore status.
Links
- Firestore Documentation - Official documentation for Firestore, useful for understanding Firestore concepts and operations.