docs/versioned_docs/version-2.62.0/data-sources/firestore.md
ToolJet can connect to Cloud Firestore databases to read and write data.
</div> <div style={{paddingTop:'24px', paddingBottom:'24px'}}>ToolJet connects to your Cloud Firestore using JSON key of your GCP service account. Get your service account key as JSON from GCP console. For generating a new key, check out Firestore's official documentation.
Once you have the key, open it in a text editor and copy the contents. Paste the contents in the Private key field of the Firestore data source modal.
Click on the Test Connection button to verify if the key is valid. Click on the Save button to save the data source.
Click on the +Add button of the query manager at the bottom panel of the editor and select the database added in the previous step as the data source.
<div style={{textAlign: 'center'}}> </div>Select the operation that you want to perform from the Operation dropdown and click on the Run button to run the query.
:::tip Query results can be transformed using transformations. Read our transformations documentation to see how: link :::
</div> <div style={{paddingTop:'24px', paddingBottom:'24px'}}>Use this operation to get the data in a document.
collection name/document id. Example: books/23e2wsds32Use this operation to query all the documents in a collection. Check firestore doc here.
booksUse this operation for creating a new document in a collection.
collection name/document id. ex: books/33243dwe2332Example body:
{
"Author": "Shubh",
"id": 5
}
Use this operation for updating the existing document in a collection. Also, it only updates fields if they exist, but doesn't replace an entire object like set operation.
collection name/document id. Example: books/33243dwe2332Example body:
{
"Author": "Shubhendra",
"id": 3
}
This operation replaces your chosen object with the value that you provide. So if your object has 5 fields, and you use Set operation and pass object with 3 fields, it will now have 3 fields.
collection name/document id. Example: books/33243dwe2332Example body:
{
"Author": "Shefewfbh",
"id": 9
}
Use this operation for bulk updating documents.
collection name/document id. ex: books/33243dwe2332Use this operation for deleting a document in a collection.
collection name/document id. ex: books/33243dwe2332The Firestore query result is in the form of object so we’ll need to transform it into array.
return data = Array(data)