Skip to main content


Apache CouchDB is an open source document-oriented NoSQL database.

Network Connection needs

This integration needs network access to the server where the service is running.

See the Network access page for details about how to achieve that.

Credential configuration

Fill in the appropiate values for your CouchDB connection. Specify the required fields: url, username and password.

In the extra options field, you can provide any of the parameters found here.

Here is an example of a filled credential configuration form in YepCode:

CouchDB Snippets available in editor


The title is the triggering text for YepCode to autocomplete the script.


New integration from credential
const couchdb = await yepcode.integration.couchdb('credential-slug')
New integration from plain authentication data
const couchdb = require("nano")({
url: "url"
await couchdb.auth("username", "password");
// You should use a yepcode env variable to don't store plain password
// See:

Create a Database

Create a database
await couchdb.db.create("database-name")
.then(() => console.log(`Database created!`))

Insert a Document

Insert a document
const sampleDocument = { foo: 'bar' };

await couchdb.use("database-name").insert(sampleDocument)
.then((result) => console.log(`Document inserted! ID: ${}`))

Get a Document

Get a document
await couchdb.use("database-name").get("document-id")
.then((result) => console.log(result))

Find Documents

Find documents
// See available options at:
const query = {
selector: {
name: "John Doe",
age: { $gte: 18 },

await couchdb.use("database-name").find(query);
.then((result) => { => {

List all Documents

List all documents
await couchdb.use("database-name").list()
.then((result) => {
console.log(`Showing ${result.total_rows} documents`)
result.rows.forEach((row) => {

Delete a Document

Delete a document
await couchdb.use("database-name").destroy("document-id", "document-rev")
.then(() => console.log(`Document deleted!`))

Delete a Database

Delete a database
await couchdb.db.destroy("database-name")
.then(() => console.log(`Database deleted!`))