Document CRUD
CouchDB documents are JSON objects with _id and _rev fields. All operations use the HTTP REST API or the nano driver.
Syntax
couchdb
db.insert(doc)
db.get(id)
db.destroy(id, rev)Example
couchdb
// Create
const { id, rev } = await db.insert({ name: 'Alice' });
// Read
const doc = await db.get(id);
// Update (must include _rev)
await db.insert({ _id: id, _rev: rev, name: 'Alice Smith' });
// Delete
await db.destroy(id, doc._rev);