5 min readUpdated Mar 2, 2026

Firestore Adapter Integration Documentation

Overview

The firestore.adapter is an integration component designed to facilitate interactions with Google Cloud Firestore. This adapter allows users to execute read and write operations on Firestore collections seamlessly within the Vantage analytics and data platform. It provides essential features such as schema introspection, real-time read and write capabilities, and the ability to manage collections effectively.

Settings

The firestore.adapter contains several configuration settings that dictate its behavior. Below are the detailed explanations for each setting:

1. databaseName

2. keyFilePath

3. operation

4. collection

5. documentId

6. data

7. merge

8. filters

9. orderBy

10. limit

11. updates

12. documents

How It Works

Upon initialization, the FirestoreAdapter connects to Firestore using the provided databaseName and keyFilePath. It then offers methods for testing the connection, listing collections, reading documents, writing data, and managing collections.

Connection Testing

The testConnection method verifies if the connection to Firestore is successful by attempting to list collections. On failure, it logs an error message.

Schema Introspection

The adapter supports schema introspection, allowing users to list collections through listCollections and to retrieve field names and types of a document using sampleDocument.

Read and Write Operations

Cleanup

The close method cleanly terminates the Firestore connection upon completion of operations, ensuring there are no dangling connections.

Use Cases & Examples

Use Case 1: Real-time Data Feeding

A company wants to feed real-time analytics data into their dashboard from user interactions stored in Firestore. The firestore.adapter can be configured to read user behavior data and update metrics in real-time for analysis.

Use Case 2: Data Synchronization

An application needs to synchronize user profiles between a Firestore database and local storage. This can be effectively managed through the executeReadOnly method to fetch user data while using executeWrite for updates.

Concrete Example

Scenario: Real-time Analytics Dashboard

Configuration Example:

json
{
  "databaseName": "analytics-project",
  "keyFilePath": "/path/to/service-account-key.json",
  "operation": "add",
  "collection": "user_interactions",
  "data": {
    "userId": "12345",
    "action": "click",
    "timestamp": {
      "_transform": "serverTimestamp"
    }
  }
}

Description: In this configuration, a new document representing a user interaction is being added to the user_interactions collection whenever a user clicks on the dashboard. The timestamp field will be populated with the server's current time at the moment of insertion, ensuring accurate recording of the interaction time.

AI Integrations and Billing Impacts

While the firestore.adapter itself does not directly integrate with AI features, data extracted from Firestore can be utilized in downstream AI applications for predictive analytics or machine learning model training.

As for billing, Firestore charges based on the number of reads, writes, and deletes performed. Therefore, understanding the usage of the firestore.adapter—such as frequent data writes or numerous read operations—can help in estimating costs associated with using Firestore through the Vantage platform.