4 min read

firestore.connector

Purpose

The firestore.connector is a specialized integration designed to connect the Vantage analytics & data platform with Google Firestore, a NoSQL cloud database. This logic allows users to read data from specified Firestore collections by verifying user credentials, fetching data based on specified filters, and enforcing pagination through limits. It streamlines the data retrieval process and ensures secure access to Firestore collections.

Settings

The component has several settings that can be configured to control its behavior. Below is a detailed explanation of each setting:

1. inputs.collection

2. inputs.filters

3. inputs.limit

How It Works

  1. User Authentication: The integration starts by checking the user session to obtain the clientId. If the user is not logged in, it raises an error.
  2. Service Validation: The logic then checks whether the Firestore service exists in the database for the specified clientId. If the service cannot be found, an appropriate message is returned.
  3. Credential Retrieval: Next, it retrieves the client credentials required to authenticate with Firestore. If no credentials are available, it returns an informative message.
  4. Integration Execution: Upon successfully obtaining the required service and credentials, the logic uses the node to set up the connection to Firestore. It then executes a read-only operation to fetch data according to user-defined parameters (collection, filters, and limit).
  5. Error Handling: Any errors during the process will generate a user-friendly error message instead of exposing technical details.

Data Expectations

Use Cases & Examples

Use Cases

  1. Data Analysis in Marketing: A marketing team wants to analyze user engagement data collected in the Firestore over the last month. They can use the firestore.connector to fetch and visualize the data without needing to export it manually.

  2. Web Application Integration: An e-commerce application needs to display product reviews stored in Firestore. By integrating this logic, the application can dynamically fetch and display reviews based on user interactions, such as filtering by product ID.

  3. Real-time Reporting: A reporting team requires access to user activity logs stored in Firestore to generate real-time insights. This integration allows them to pull the latest logs and apply filters as needed, enhancing reporting capabilities.

Example Configuration

Assuming a business case where a marketing team needs to fetch user engagement data based on certain campaign filters, the following configuration could be applied:

json
{
  "inputs": {
    "collection": "user_engagements",
    "filters": [
      { "key": "campaign", "value": "summer_sale" },
      { "key": "engaged", "value": true }
    ],
    "limit": 100
  }
}

In this example, the inputs configuration would retrieve all documents from the "user_engagements" collection where the campaign is labeled "summer_sale" and the engagement status is marked as true. The results would be limited to a maximum of 100 entries, making it easy to analyze the campaign's effectiveness without overwhelming data volume.