Firestore Jogamais

Interact with Firestore for Joga+ app

Overview

This node interacts with Firestore for the Joga+ app, allowing users to perform CRUD operations on Firestore collections and documents. It supports fetching documents, adding new documents, updating existing documents, deleting documents, and retrieving groups within a specified draw window based on a reference date. This node is useful for managing Firestore data dynamically within n8n workflows, such as syncing app data, managing user groups, or scheduling matches.

Use Case Examples

  1. Fetch all documents from a specified Firestore collection.
  2. Add a new document with JSON data to a Firestore collection.
  3. Update an existing document by its ID with new data.
  4. Delete a document by its ID from a Firestore collection.

Properties

Name Meaning
Collection The Firestore collection to operate on.
Reference Date (ISO) ISO date-time used as a reference for the 'Get Groups In Draw Window' operation; defaults to current time if empty.
Document ID The ID of the document to update or delete; optional for other operations.
Data (JSON) JSON data to write or update in the document.

Output

JSON

  • id - The document ID in Firestore.
    - Fields of the document data retrieved or modified.
  • updated - Indicates the document was successfully updated (only for update operation).
  • deleted - Indicates the document was successfully deleted (only for delete operation).
  • groupId - ID of the group (only for 'Get Groups In Draw Window' operation).
    group
  • id - ID of the group in the nested group object.
    - Fields of the group document data.
  • matchId - ID of the match within the group (only for 'Get Groups In Draw Window' operation).
    match
  • id - ID of the match document in the nested match object.
    - Fields of the match document data.
  • window
    • start - 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.
  • Verify that the 'collection' parameter is correctly specified and exists in Firestore.
  • For update and delete operations, ensure the 'Document ID' is provided and valid.
  • When using 'Get Groups In Draw Window', provide a valid ISO date-time string for 'Reference Date' or leave it empty to use the current time.
  • Handle errors related to invalid date formats or Firestore access issues by checking error messages and adjusting inputs accordingly.

Links

  • Firestore Documentation - Official documentation for Firestore, useful for understanding Firestore concepts and operations.

Discussion