Firestore
This page provides information for connecting your application to your Firestore database and for using queries to manage its content.
Connection parameters
The following section is a reference guide that provides a complete description of all the parameters to connect to a Firestore database.

Database URL
The domain or network location of your database instance. This value includes your Project ID in the format
https://PROJECT_ID.firebaseio.com
Project ID
The unique identifier for your Firestore project, accessible in your Firebase project's Project Settings. For more information, see Understand Firebase projects.
Service account credentials
Service account credentials are used to authenticate your queries to Firestore. To obtain them:
-
In the Firebase console, navigate to Project Settings > Service accounts, and click Generate new private key to download the JSON file.
-
Open the downloaded JSON file and copy its contents.
-
Paste the copied credentials into the Service account credentials field in your Appsmith datasource configuration.
Create queries
The following section is a reference guide that provides a complete description of all the read and write operation commands with their parameters to create Firestore queries.

List Documents
This command lists all documents from a given collection. The following section lists all the fields available for the List Documents command.
Collection Name
The name of the collection to query.
Where
Defines conditions that documents' column values must meet to appear in your results. The available comparison operators are ==
, <
, <=
, >=
, >
, in
, contains
, and contains any
.
- Add condition: Adds another simple single-line expression.
- Add group condition: Adds a nested expression with multiple levels of
AND
statements.

Order by
Sorts query results by a column value. Expects a JSON array containing a single string which is the column's name. By default this sorts in ascending order, or you can add a -
prefix to the column name to sort in descending order. For example, ["name"]
is ascending and ["-name"]
is descending.
Start after
Sets a record that acts as a starting cursor for pagination in Firestore. Expects an object that is a whole document, i.e. a document that was returned from a prior query. For example, you can pass the last record from the most recent execution of a query:
Example:
//Table example
{{ user_Table.tableData[user_Table.tableData.length - 1] }}
//List example
{{ users_List.data[users_List.data.length - 1] }}
Each time the query is run, it fetches the next set of results that come after the previous execution.
End before
Sets a record that acts as an ending cursor for pagination. Expects an object that is a whole document, i.e. a document that was returned from a prior query. For example, you can pass the first record from the most recent execution of a query:
{{ user_Table.tableData[0] }}
When the query is paged backwards, it fetches the set of results that lead up to the current results.