CouchDB#
Insight² 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 Insight². For more info visit CouchDB docs.
Supported queries:#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
Retrieving a record#
Required parameters:#
- Record ID
Example response from CouchDb:
1 2 3 4 5 6 7 |
|
Creating a record#
Example Records:#
1 |
|
Click on the run
button to run the query.
NOTE: Query must be saved before running.
Example response from CouchDb:
1 2 3 4 5 |
|
Updating a record#
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.
Required parameters:#
- Revision ID
- Record ID
Example body:#
1 |
|
Click on the run
button to run the query.
NOTE: Query must be saved before running.
Example response from CouchDb:
1 2 3 4 5 |
|
Deleting a record#
Required parameters:#
- Revision ID
- Record ID
Click on the run
button to run the query.
Example response from CouchDb:
1 2 3 4 5 |
|
Find#
Find documents using a declarative JSON querying syntax.
Required parameters:#
- Selector
NOTE: selector syntax
Example body:#
1 2 3 4 5 6 |
|
Click on the run
button to run the query.
NOTE: selector (json) – JSON object describing criteria used to select documents.
Example response from CouchDb:
Retrieving a view#
Views are the primary tool used for querying and reporting on CouchDB documents.
Required parameters:#
- View url
Optional parameters:#
- Start key
- End key
- Limit
- Skip
Click on the run
button to run the query.
startkey (json) – Return records starting with the specified key.
endkey (json) – Stop returning records when the specified key is reached.
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.
Example response from CouchDb:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|