Firestore is a highly durable database that can scale automatically to handle your application’s load.
Firebase Configuration Details: To connect with Firestore, gather the necessary configuration details from the Firebase console using these steps:
Access your Project settings.
Navigate to the Service accounts tab.
Click on the Firebase Admin SDK icon to generate a new private key.
Download the resulting JSON file and extract the Private key. This key is crucial for configuring the Firestore Connector.
Optionally, Google Cloud Platform Account Key: If you prefer, you can create an account key through your Google Cloud Platform (GCP) console:
- Choose a project in your GCP console.
Create Service Accountand assign the
- Opt for a JSON Key type and download the resulting file. Ensure accessibility of this file for the connector's configuration.
Configuring Connector in DronaHQ
Configure your database category using the provided details. Validate connection with
Test connection and
settings for secure database setup.
|Firebase Database URL
|Enter the URL of your Firebase Realtime Database, e.g.,
|Paste the contents of the Private Key obtained from the Firebase console or GCP console.
value connection options in database configuration refer to specific settings (keys) and their corresponding values that dictate how the application connects to the database
|Enhance security by restricting database access to specific whitelisted IP addresses.
Adding Queries for Firestore
Once you've successfully configured the Firestore connector, you can efficiently manage data-related operations,
Update Document action. Follow these steps to create and execute queries:
Define Query Name: Provide a unique name for your data management query. This name will serve as an identifier in your Connector Library for easy access and management.
Select Action - Update Document: Within the Firestore connector options, choose the
Update Documentaction. This action enables you to modify existing data entries within a specific document in your Firestore database.
Choose Collection: After selecting the
Update Documentaction, you'll have the option to choose the Firestore collection containing the document you want to update.
Set Additional Parameters: Depending on your specific requirements, utilize optional parameters to refine the
Update Documentaction. Customize the query by implementing filters, sorting criteria, or other pertinent options.
|Specify the field for sorting the results in ascending or descending order.
|Define the sorting direction, either ascending or descending.
|Filter documents based on specified conditions.
|Limit the number of documents returned in the query results.
|Start the query results at a specific document.
|End the query results at a specific document.
|Target a specific document by its unique identifier.
|Provide a specific value for query comparisons.
|Parent Document ID
|Reference the parent document ID for subcollection queries.
This table outlines the parameters you can utilize for performing queries and operations on your Firestore database, including ordering, filtering, limiting, and targeting specific documents.
- Test and Execute: Before finalizing the query, perform a test run to verify its functionality. Confirm that the document's data is correctly updated within your Firestore database.
Utilize double curly brackets for incorporating dynamic variables. Prior to saving, test with sample values. Associate dynamic variables with controls/actions for real-time utilization. :::
Your saved queries will be visible beneath your connector within the Connector Library.
Supported Actions for Firestore
|Execute a query to retrieve documents from a Firestore collection based on specified criteria.
|Insert a new document into a Firestore collection.
|Update an existing document within a Firestore collection.
|Get Document by ID
|Retrieve a document from a Firestore collection by its unique identifier.
|Delete a document from a Firestore collection.
|Retrieve a list of collections within a Firestore database.
|Query Collection Groups
|Execute a query to retrieve documents from multiple collections that share the same ID.
Using Firestore Connector
Access Data Management Section or Control Action:
- Begin by navigating to the data management section or the control action where you want to interact with your Firestore database.
Select Firebase Firestore Connector:
Choose the Firebase Firestore Connector from your available options.
Opt for the "Insert Document" action to add new data to your Firestore collection.
Provide a Document ID if desired; otherwise, leave it blank for auto-generation.
Ensure that the data is in valid JSON format.
Configuration for Data Input:
Configure the action by providing the necessary data in a valid JSON format.
This could involve collecting data from a form submission and adding it using the action.
Execute the Action Flow:
- Configure the Connector within the Action Flow or Server Side actions.
- Link the action to a button click or relevant trigger.
- When the form is submitted, the action flow triggers the Connector to save data to your Firestore collection.
Confirmation and Display:
- After the action is executed, use popup or toast actions to display relevant information, such as the created document ID.
- You can also display the added data in a table grid or any other appropriate visualization.