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. 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

  1. Updating a document in a Firestore collection by specifying the collection name, document ID, and the data to update.
  2. Retrieving all documents from a Firestore collection to process or analyze data.
  3. Adding a new document to a Firestore collection with specified JSON data.
  4. Deleting a document from a Firestore collection by providing its document ID.

Properties

Name Meaning
Collection The Firestore collection to interact with.
Reference Date (ISO) An ISO date-time string used as a reference when retrieving groups in a draw window. 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 document ID in Firestore.
  • updated - Indicates the document was successfully updated (present only for update operation).
  • deleted - Indicates the document was successfully deleted (present only for delete operation).
  • groupId - The ID of the group when retrieving groups in a draw window.
  • group - The group document data.
  • matchId - The ID of the match document within a group.
  • match - The match document data.
  • window
    • start - The start ISO date-time of the draw window.
    • end - The end ISO date-time of the draw window.
    • lockMinutes - The 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' and 'docId' parameters are correctly set, especially for update and delete operations where 'docId' is required.
  • For the 'Get Groups In Draw Window' operation, ensure the 'Reference Date (ISO)' is a valid ISO date-time string; otherwise, an error will be thrown.
  • Check network connectivity and Firestore service availability if operations fail unexpectedly.

Links

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

Discussion