CouchDB
ToolJet can connect to CouchDB databases to read and write data. CocuhDB uses basic auth for authentication , username and password for the database is required to create an CouchDB data source on ToolJet. For more info visit CouchDB docs.
Supported Queries:
- Listing Records
- Retrieving a Record
- Creating a Record
- Updating a Record
- Deleting a Record
- Find
- Retrieving a View
NOTE: Record ID is same as document ID("_id") .
Listing Records
This query lists all the records in a database.
Optional Parameters:
- Include docs
- Descending order
- Limit
- Skip
descending (boolean) – Return the documents in descending order by key. Default is false.
limit (number) – Limit the number of the returned documents to the specified number.
skip (number) – Skip this number of records before starting to return the results. Default is 0.
include_docs (boolean) – include_docs key is set to false by default , if true it returns the document data along with the default fields.
Example response from CouchDb:
{
"total_rows": 3,
"offset": 0,
"rows": [
{
"id": "23212104e60a71edb42ebc509f000dc2",
"key": "23212104e60a71edb42ebc509f000dc2",
"value": {
"rev": "1-0cc7f48876f15883394e5c139c628123"
}
},
{
"id": "23212104e60a71edb42ebc509f00216e",
"key": "23212104e60a71edb42ebc509f00216e",
"value": {
"rev": "1-b3c45696b10cb08221a335ff7cbd8b7a"
}
},
{
"id": "23212104e60a71edb42ebc509f00282a",
"key": "23212104e60a71edb42ebc509f00282a",
"value": {
"rev": "1-da5732beb913ecbded309321cac892d2"
}
},
]
}
Retrieving a Record
Required Parameters:
- Record ID
Example response from CouchDb:
{
"_id": "e33dc4e209689cb0400d095fc401a1e0",
"_rev": "1-a62af8e14451af88c150e7e718b7a0e8",
"0": {
"name": "test data"
}
}
The returned JSON is the JSON of the document, including the document ID and revision number: