Firestore Source
3 minute read
About
Firestore is a NoSQL document database built for automatic scaling, high performance, and ease of application development. While the Firestore interface has many of the same features as traditional databases, as a NoSQL database it differs from them in the way it describes relationships between data objects.
If you are new to Firestore, you can create a database and learn the basics.
Available Tools
Firestore Source Tools
| Tool Name | Description |
|---|---|
| firestore-add-documents Tool | A "firestore-add-documents" tool adds document to a given collection path. |
| firestore-delete-documents Tool | A "firestore-delete-documents" tool deletes multiple documents from Firestore by their paths. |
| firestore-get-documents Tool | A "firestore-get-documents" tool retrieves multiple documents from Firestore by their paths. |
| firestore-get-rules Tool | A "firestore-get-rules" tool retrieves the active Firestore security rules for the current project. |
| firestore-list-collections Tool | A "firestore-list-collections" tool lists collections in Firestore, either at the root level or as subcollections of a document. |
| firestore-query Tool | Query a Firestore collection with parameterizable filters and Firestore native JSON value types |
| firestore-query-collection Tool | A "firestore-query-collection" tool allow to query collections in Firestore. |
| firestore-update-document Tool | A "firestore-update-document" tool updates an existing document in Firestore. |
| firestore-validate-rules Tool | A "firestore-validate-rules" tool validates Firestore security rules syntax and semantic correctness without deploying them. It provides detailed error reporting with source positions and code snippets. |
Requirements
IAM Permissions
Firestore uses Identity and Access Management (IAM) to control user and group access to Firestore resources. Toolbox will use your Application Default Credentials (ADC) to authorize and authenticate when interacting with Firestore.
In addition to setting the ADC for your server, you need to ensure the IAM identity has been given the correct IAM permissions for accessing Firestore. Common roles include:
roles/datastore.user- Read and write access to Firestoreroles/datastore.viewer- Read-only access to Firestoreroles/firebaserules.admin- Full management of Firebase Security Rules for Firestore. This role is required for operations that involve creating, updating, or managing Firestore security rules (see Firebase Security Rules roles)
See Firestore access control for more information on applying IAM permissions and roles to an identity.
Database Selection
Firestore allows you to create multiple databases within a single project. Each
database is isolated from the others and has its own set of documents and
collections. If you don’t specify a database in your configuration, the default
database named (default) will be used.
Example
kind: sources
name: my-firestore-source
type: "firestore"
project: "my-project-id"
# database: "my-database" # Optional, defaults to "(default)"
Reference
| field | type | required | description |
|---|---|---|---|
| type | string | true | Must be “firestore”. |
| project | string | true | Id of the GCP project that contains the Firestore database (e.g. “my-project-id”). |
| database | string | false | Name of the Firestore database to connect to. Defaults to “(default)” if not specified. |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.