CouchDB
Read and write Apache CouchDB documents: Mango queries, views, changes feed and bulk documents with revisions. Typical uses: sync documents with an application, follow changes.
couchdb pingcouchdb infocouchdb collection_createcouchdb collection_createcouchdb collectionscouchdb putcouchdb getcouchdb getcouchdb insertcouchdb insertcouchdb findcouchdb findcouchdb countcouchdb countcouchdb updatecouchdb updatecouchdb deletecouchdb deletecouchdb delete_wherecouchdb all_docscouchdb all_docscouchdb viewcouchdb viewcouchdb changescouchdb changescouchdb collection_infocouchdb requestcouchdb requestcouchdb collection_drop

couchdb ping <config>


Description

    Test the connection and the credentials: {ok, version}

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
admin
couchdb ping "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}"
mentdb
{"ok": true, "version": "3.5.3"}

couchdb info <config>


Description

    The welcome object of the server (version, features, vendor)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
admin
couchdb info "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}"
mentdb
{"couchdb": "Welcome", "version": "3.5.3", "git_sha": "7a1f97558", "uuid": "8a6cc12ba89d92882aa24dcb1b243c5e", "features": ["quickjs", "access-ready", "partitioned", "pluggable-storage-engines", "reshard", "scheduler"], "vendor": {"name": "The Apache Software Foundation"}}

couchdb collection_create <config> <db>


Description

    Create a database: {created}

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
admin
couchdb collection_create "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop"
mentdb
{"created": "shop"}

couchdb collection_create <config> <db> <json_options>


Description

    Create a database with options: q (shards), n (replicas), partitioned, if_missing (true: no error when it exists, {created: null, exists})

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_options:   The options - String - required
admin
couchdb collection_create "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"if_missing\": true}"
mentdb
{"created": null, "exists": "shop"}

couchdb collections <config>


Description

    The databases of the server (_all_dbs)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
admin
couchdb collections "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}"
mentdb
["_replicator", "_users", "shop"]

couchdb put <config> <db> <id> <json_doc>


Description

    Create or replace a document by id; the current _rev is read when the document has none. Returns {id, rev}

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    id:   The document id (_design/... and _local/... allowed, no other id starting with _) - String - required
    json_doc:   The document as a JSON object - String - required
admin
couchdb put "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "c1" "{\"name\": \"Zoé\", \"city\": \"Paris\", \"age\": 31}"
mentdb
{"id": "c1", "rev": "1-e59a180cd335fbdaa449fbf4b87a54a1"}
a new revision (fixed result: real Apache CouchDB 3.5.3)
admin
couchdb put "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "c1" "{\"name\": \"Zoé\", \"city\": \"Lyon\", \"age\": 32}"
mentdb
{"id": "c1", "rev": "2-cc333503a552c277766fc3555e33a5f7"}

couchdb get <config> <db> <id>


Description

    A document with its _id and _rev; null if it does not exist (an error if the database does not exist)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    id:   The document id (_design/... and _local/... allowed, no other id starting with _) - String - required
admin
couchdb get "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "c1"
mentdb
{"_id": "c1", "_rev": "2-cc333503a552c277766fc3555e33a5f7", "name": "Zoé", "city": "Lyon", "age": 32}
no such document (fixed result: real Apache CouchDB 3.5.3)
admin
couchdb get "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "nothing"
mentdb
null

couchdb get <config> <db> <id> <json_options>


Description

    A document with options: rev (an older revision), revs_info, conflicts, attachments

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    id:   The document id (_design/... and _local/... allowed, no other id starting with _) - String - required
    json_options:   The options - String - required
admin
couchdb get "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "c1" "{\"revs_info\": true}"
mentdb
{"_id": "c1", "_rev": "2-cc333503a552c277766fc3555e33a5f7", "name": "Zoé", "city": "Lyon", "age": 32, "_revs_info": [{"rev": "2-cc333503a552c277766fc3555e33a5f7", "status": "available"}, {"rev": "1-e59a180cd335fbdaa449fbf4b87a54a1", "status": "available"}]}

couchdb insert <config> <db> <json_rows>


Description

    Insert rows with _bulk_docs, in batches of 1000: {inserted, errors, ids}; an error (a conflict) does not stop the other rows. Without an _id, CouchDB makes one

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_rows:   The rows: a JSON array of objects (100000 at most) - String - required
admin
couchdb insert "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "[{\"_id\": \"c2\", \"name\": \"Paul\", \"city\": \"Paris\", \"age\": 45}, {\"_id\": \"c3\", \"name\": \"Ana\", \"city\": \"Nice\", \"age\": 19}]"
mentdb
{"inserted": 2, "errors": [], "ids": ["c2", "c3"]}

couchdb insert <config> <db> <json_rows> <json_options>


Description

    Insert rows with options: id_field (a field copied to _id; it stays in the document), batch_size (1000)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_rows:   The rows: a JSON array of objects (100000 at most) - String - required
    json_options:   The options - String - required
admin
couchdb insert "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "[{\"code\": \"c4\", \"name\": \"Max\", \"city\": \"Lyon\", \"age\": 52}, {\"code\": \"c1\", \"name\": \"again\"}]" "{\"id_field\": \"code\"}"
mentdb
{"inserted": 1, "errors": [{"id": "c1", "error": "conflict: Document update conflict."}], "ids": ["c4"]}

couchdb find <config> <db> <json_filter>


Description

    Mango query: the documents as rows (1000 at most; the bookmarks are followed). The filter is a Mango selector, which also accepts $regex, $or, $elemMatch...

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_filter:   The filter, the same for every NoSQL family: {"city": "Paris", "age": {"$gte": 18}}; operators $eq $ne $gt $gte $lt $lte $in $nin; the conditions are combined with AND - String - required
admin
couchdb find "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"age\": {\"$gte\": 20}}"
mentdb
[{"_id": "c1", "_rev": "2-cc333503a552c277766fc3555e33a5f7", "name": "Zoé", "city": "Lyon", "age": 32}, {"_id": "c2", "_rev": "1-559d4c8dbc7bc1faad15631494561fca", "name": "Paul", "city": "Paris", "age": 45}, {"_id": "c4", "_rev": "1-294193e47088367685095c5f383b8ef1", "code": "c4", "name": "Max", "city": "Lyon", "age": 52}]

couchdb find <config> <db> <json_filter> <json_options>


Description

    Mango query with options: Options: limit (1000, 100000 at most), skip, sort ({"age": -1} or [["age", "desc"]]), fields (an array of field names), use_index, page_size (1000). A sort needs an index (couchdb request POST /db/_index)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_filter:   The filter, the same for every NoSQL family: {"city": "Paris", "age": {"$gte": 18}}; operators $eq $ne $gt $gte $lt $lte $in $nin; the conditions are combined with AND - String - required
    json_options:   The options - String - required
admin
couchdb find "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"city\": {\"$in\": [\"Paris\", \"Nice\"]}}" "{\"fields\": [\"_id\", \"name\", \"age\"], \"limit\": 10}"
mentdb
[{"_id": "c2", "name": "Paul", "age": 45}, {"_id": "c3", "name": "Ana", "age": 19}]

couchdb count <config> <db>


Description

    The number of documents of the database (doc_count, design documents included)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
admin
couchdb count "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop"
mentdb
4

couchdb count <config> <db> <json_filter>


Description

    The number of documents matching a filter (100000 at most)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_filter:   The filter, the same for every NoSQL family: {"city": "Paris", "age": {"$gte": 18}}; operators $eq $ne $gt $gte $lt $lte $in $nin; the conditions are combined with AND - String - required
admin
couchdb count "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"city\": \"Paris\"}"
mentdb
1

couchdb update <config> <db> <json_filter> <json_changes>


Description

    Set top-level fields in the matching documents (one _bulk_docs per 1000): {matched, modified}; a document changed meanwhile is not modified (conflict)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_filter:   The filter, the same for every NoSQL family: {"city": "Paris", "age": {"$gte": 18}}; operators $eq $ne $gt $gte $lt $lte $in $nin; the conditions are combined with AND - String - required
    json_changes:   The new values of top-level fields, like {"vip": true} - String - required
admin
couchdb update "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"city\": \"Paris\"}" "{\"vip\": true}"
mentdb
{"matched": 1, "modified": 1}

couchdb update <config> <db> <json_filter> <json_changes> <json_options>


Description

    Update with options: limit (100000)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_filter:   The filter, the same for every NoSQL family: {"city": "Paris", "age": {"$gte": 18}}; operators $eq $ne $gt $gte $lt $lte $in $nin; the conditions are combined with AND - String - required
    json_changes:   The new values of top-level fields, like {"vip": true} - String - required
    json_options:   The options - String - required
admin
couchdb update "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"age\": {\"$gt\": 40}}" "{\"senior\": true}" "{\"limit\": 1}"
mentdb
{"matched": 1, "modified": 1}

couchdb delete <config> <db> <id>


Description

    Delete a document (its current revision is read): {deleted: 1}, {deleted: 0} if it does not exist

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    id:   The document id (_design/... and _local/... allowed, no other id starting with _) - String - required
admin
couchdb delete "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "c3"
mentdb
{"deleted": 0}

couchdb delete <config> <db> <id> <rev>


Description

    Delete a given revision (a conflict if it is not the current one)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    id:   The document id (_design/... and _local/... allowed, no other id starting with _) - String - required
    rev:   The revision - String - required
admin
couchdb delete "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "c1" "1-e59a180cd335fbdaa449fbf4b87a54a1"
mentdb
ERROR: Sorry, an error appears (CouchDB error conflict: Document update conflict. (HTTP 409)).

couchdb delete_where <config> <db> <json_filter>


Description

    Delete the documents matching a filter (design documents excluded, 100000 at most): {deleted}

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_filter:   The filter, the same for every NoSQL family: {"city": "Paris", "age": {"$gte": 18}}; operators $eq $ne $gt $gte $lt $lte $in $nin; the conditions are combined with AND - String - required
admin
couchdb delete_where "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"senior\": true}"
mentdb
{"deleted": 1}

couchdb all_docs <config> <db>


Description

    The rows {id, key, value: {rev}} of _all_docs (1000 at most)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
admin
couchdb all_docs "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop"
mentdb
[{"id": "c1", "key": "c1", "value": {"rev": "2-cc333503a552c277766fc3555e33a5f7"}}, {"id": "c4", "key": "c4", "value": {"rev": "1-294193e47088367685095c5f383b8ef1"}}]

couchdb all_docs <config> <db> <json_options>


Description

    _all_docs with options: include_docs (the documents as rows), limit, skip, key, keys, startkey, endkey, descending, inclusive_end

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_options:   The options - String - required
admin
couchdb all_docs "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"include_docs\": true, \"limit\": 2}"
mentdb
[{"_id": "c1", "_rev": "2-cc333503a552c277766fc3555e33a5f7", "name": "Zoé", "city": "Lyon", "age": 32}, {"_id": "c4", "_rev": "1-294193e47088367685095c5f383b8ef1", "code": "c4", "name": "Max", "city": "Lyon", "age": 52}]

couchdb view <config> <db> <design> <view>


Description

    Query a view of a design document: rows {id, key, value} (or {key, value} when reduced)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    design:   The design document, with or without _design/ - String - required
    view:   The view - String - required
admin
couchdb view "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "stats" "age_by_city"
mentdb
[{"key": null, "value": 84}]

couchdb view <config> <db> <design> <view> <json_options>


Description

    A view with options: key, keys, startkey, endkey, reduce, group, group_level, include_docs, limit (1000), skip, descending, stale (ok or update_after)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    design:   The design document - String - required
    view:   The view - String - required
    json_options:   The options - String - required
admin
couchdb view "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "stats" "age_by_city" "{\"group\": true}"
mentdb
[{"key": "Lyon", "value": 84}]

couchdb changes <config> <db>


Description

    The changes feed (normal mode): {results: [{id, seq, rev, deleted}], last_seq, pending}, 100 changes by default

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
admin
couchdb changes "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop"
mentdb
{"results": [{"id": "c1", "seq": "2-g1AAAAB5eJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZEpFyjAbmphkWiQnIpNAx5j8liAJEMDkPoPMi2RIQsAx4UmoQ", "rev": "2-cc333503a552c277766fc3555e33a5f7", "deleted": false}, {"id": "c4", "seq": "3-g1AAAAB5eJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZE5FyjAbmphkWiQnIpNAx5j8liAJEMDkPoPMi2RIQsAx9Mmog", "rev": "1-294193e47088367685095c5f383b8ef1", "deleted": false}, {"id": "c3", "seq": "8-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZE5FyjAbmphkWiQnIpNAx5j8liAJEMDkPoPNY0VYpqpqVmiWTI2fVkAc8Awqw", "rev": "2-4826ce8d7935a993bf7e64f320ce9874", "deleted": true}, {"id": "c2", "seq": "9-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZE5FyjAbmphkWiQnIpNAx5j8liAJEMDkPoPNY0NYpqpqVmiWTI2fVkAc-IwrA", "rev": "4-eff3e2efbee90516b0535cccec2e8175", "deleted": true}, {"id": "_design/stats", "seq": "10-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZE5FyjAbmphkWiQnIpNAx5j8liAJEMDkPoPNY0dYpqpqVmiWTI2fVkAdAQwrQ", "rev": "1-88ea65c645429bd0dd103f75225cad8a", "deleted": false}], "last_seq": "10-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZE5FyjAbmphkWiQnIpNAx5j8liAJEMDkPoPNY0dYpqpqVmiWTI2fVkAdAQwrQ", "pending": 0}

couchdb changes <config> <db> <json_options>


Description

    Changes with options: since (a last_seq or now), limit (100, 10000 at most), include_docs, descending, conflicts, style, selector (a Mango filter) or doc_ids

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
    json_options:   The options - String - required
admin
couchdb changes "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop" "{\"selector\": {\"city\": \"Lyon\"}, \"include_docs\": true}"
mentdb
{"results": [{"id": "c1", "seq": "2-g1AAAAB5eJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZEpFyjAbmphkWiQnIpNAx5j8liAJEMDkPoPMi2RIQsAx4UmoQ", "rev": "2-cc333503a552c277766fc3555e33a5f7", "deleted": false, "doc": {"_id": "c1", "_rev": "2-cc333503a552c277766fc3555e33a5f7", "name": "Zoé", "city": "Lyon", "age": 32}}, {"id": "c4", "seq": "9-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZE5FyjAbmphkWiQnIpNAx5j8liAJEMDkPoPNY0NYpqpqVmiWTI2fVkAc-IwrA", "rev": "1-294193e47088367685095c5f383b8ef1", "deleted": false, "doc": {"_id": "c4", "_rev": "1-294193e47088367685095c5f383b8ef1", "code": "c4", "name": "Max", "city": "Lyon", "age": 52}}], "last_seq": "10-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUklMiTV____PyuDOZE5FyjAbmphkWiQnIpNAx5j8liAJEMDkPoPNY0dYpqpqVmiWTI2fVkAdAQwrQ", "pending": 0}

couchdb collection_info <config> <db>


Description

    The information of a database (counts, sizes, cluster)

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
admin
couchdb collection_info "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop"
mentdb
{"instance_start_time": "1794916089", "db_name": "shop", "purge_seq": "0-g1AAAABXeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUnlsQBJhgYg9R8IshIZ8KhNZEiqhyjKAgBm5Rxs", "update_seq": "10-g1AAAACbeJzLYWBgYMpgTmEQTM4vTc5ISXLIyU9OzMnILy7JAUnlsQBJhgYg9R8IsjKYE9lzgQLspqamZolmydj04TEtkSGpHmoMM8QYC4tEg-RUbBqyABQ1MK0", "sizes": {"file": 65930, "external": 197, "active": 1893}, "props": {}, "doc_del_count": 2, "doc_count": 3, "disk_format_version": 8, "compact_running": false, "cluster": {"q": 2, "n": 1, "w": 1, "r": 1}}

couchdb request <config> <method> <path>


Description

    Any request of the HTTP API (GET PUT POST DELETE HEAD COPY): the JSON answer

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    method:   The HTTP method - String - required
    path:   The path from the root of the server, starting with / (encoded) - String - required
admin
couchdb request "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "GET" "/_up"
mentdb
{"seeds": {}, "status": "ok"}

couchdb request <config> <method> <path> <json_body>


Description

    Any request with a JSON body

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    method:   The HTTP method - String - required
    path:   The path from the root of the server, starting with / (encoded) - String - required
    json_body:   The JSON body - String - required
admin
couchdb request "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "POST" "/shop/_index" "{\"index\": {\"fields\": [\"age\"]}, \"name\": \"by-age\"}"
mentdb
{"result": "created", "id": "_design/49eaaac5397295a2a5aa89480d1d85bed2ecd3b1", "name": "by-age"}

couchdb collection_drop <config> <db>


Description

    Delete a database: {dropped}, {dropped: null} if it does not exist

Parameters

    config:   The CouchDB configuration as JSON: url (http://127.0.0.1:5984; a path prefix is allowed), username and password (the name of a secret: secret set), or token (or token: a bearer token, for IAM or JWT), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, 256 MB at most: the size of an answer) - String - required
    db:   The database (the collection of CouchDB): lowercase letters, digits and _$()+-/ - String - required
admin
couchdb collection_drop "{\"url\": \"http://127.0.0.1:5984\", \"username\": \"admin\", \"password\": \"couchdb_password\"}" "shop"
mentdb
{"dropped": "shop"}