docs/versioned_docs/version-3.0.0-LTS/data-sources/couchdb.md
ToolJet can connect to CouchDB databases to read and write data.
<div style={{paddingTop:'24px'}}>To establish a connection with the CouchDB data source, you can either click on the + Add new Data source button located on the query panel or navigate to the Data Sources page through the ToolJet dashboard.
ToolJet requires the following to connect to your CouchDB.
This query lists all the records in a database.
This operation fetches a single record by its record ID.
Inserts a new record into the database.
[{"name":"tooljet"}]
You can get the revision id value, by sending a GET request to get the document details. You get the document as JSON in the response. For each update to the document, the revision field "_rev" gets changed.
[{"name":"tooljet"}]
Removes a record from the database by its record ID.
Find documents using a declarative JSON querying syntax.
:::info NOTE: selector syntax: https://pouchdb.com/guides/mango-queries.html :::
{
"selector": {
"year": {"$gte": 2015}
},
"fields": ["year"]
}
Example response from CouchDB:
Views are the primary tool used for querying and reporting on CouchDB documents.