Couchbase
Query Couchbase with SQL++ and read or write documents by key or JSON filter, buckets and collections. Typical uses: read a Couchbase application's documents, load rows in bulk.
couchbase pingcouchbase infocouchbase databasescouchbase collection_createcouchbase collection_createcouchbase collectionscouchbase collectionscouchbase collection_infocouchbase putcouchbase putcouchbase getcouchbase insertcouchbase insertcouchbase findcouchbase findcouchbase countcouchbase countcouchbase updatecouchbase updatecouchbase querycouchbase querycouchbase executecouchbase executecouchbase deletecouchbase delete_wherecouchbase requestcouchbase requestcouchbase collection_drop
couchbase ping <config>
Description
Test the connection and the credentials on the management API. Returns {ok, version}
Test the connection and the credentials on the management API. Returns {ok, version}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
couchbase ping "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}"
mentdb
{"ok": true, "version": "7.6.2-3721-community"}
couchbase info <config>
Description
The cluster: {version, cluster_initialized, nodes: [{hostname, status, version, services}], buckets: [{name, type, storage_backend, ram_quota_mb, item_count, replicas}]}
The cluster: {version, cluster_initialized, nodes: [{hostname, status, version, services}], buckets: [{name, type, storage_backend, ram_quota_mb, item_count, replicas}]}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
couchbase info "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}"
mentdb
{"version": "7.6.2-3721-community", "cluster_initialized": true, "nodes": [{"hostname": "127.0.0.1:8091", "status": "healthy", "version": "7.6.2-3721-community", "services": ["index", "kv", "n1ql"]}], "buckets": [{"name": "shop", "type": "membase", "storage_backend": "couchstore", "ram_quota_mb": 256, "item_count": 0, "replicas": 0}]}
couchbase databases <config>
Description
The names of the buckets (the level above the scopes and collections)
The names of the buckets (the level above the scopes and collections)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
couchbase databases "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}"
mentdb
["shop"]
couchbase collection_create <config> <keyspace>
Description
Create a collection bucket.scope.collection (the scope is created when missing) and its primary index; the bucket must exist (create it in the Couchbase console). Waits until the Query service sees it (10 s at most). Returns {created}
Create a collection bucket.scope.collection (the scope is created when missing) and its primary index; the bucket must exist (create it in the Couchbase console). Waits until the Query service sees it (10 s at most). Returns {created}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
admin
couchbase collection_create "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers"
mentdb
{"created": "shop.sales.customers"}
couchbase collection_create <config> <keyspace> <options_json>
Description
Create a collection with options: primary_index (true), max_ttl (seconds, the default expiry of the documents: Enterprise edition and Capella only)
Create a collection with options: primary_index (true), max_ttl (seconds, the default expiry of the documents: Enterprise edition and Capella only)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
options_json: The options - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
options_json: The options - String - required
admin
couchbase collection_create "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.sessions" "{\"primary_index\": false}"
mentdb
{"created": "shop.sales.sessions"}
couchbase collections <config>
Description
The keyspaces bucket.scope.collection of every bucket (the _system scope is left out)
The keyspaces bucket.scope.collection of every bucket (the _system scope is left out)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
couchbase collections "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}"
mentdb
["shop.sales.sessions", "shop.sales.customers", "shop._default._default"]
couchbase collections <config> <bucket>
Description
The keyspaces of one bucket
The keyspaces of one bucket
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
bucket: The bucket - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
bucket: The bucket - String - required
admin
couchbase collections "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop"
mentdb
["shop.sales.sessions", "shop.sales.customers", "shop._default._default"]
couchbase collection_info <config> <keyspace>
Description
A collection: {keyspace, bucket, scope, collection, max_ttl, indexes: [{name, is_primary, index_key, state}]}
A collection: {keyspace, bucket, scope, collection, max_ttl, indexes: [{name, is_primary, index_key, state}]}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
admin
couchbase collection_info "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers"
mentdb
{"keyspace": "shop.sales.customers", "bucket": "shop", "scope": "sales", "collection": "customers", "max_ttl": 0, "indexes": [{"name": "#primary", "is_primary": true, "index_key": [], "state": "online"}]}
couchbase put <config> <keyspace> <id> <document_json>
Description
Write one document by its key (upsert: created or replaced). Returns {id}
Write one document by its key (upsert: created or replaced). Returns {id}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
document_json: The document as a JSON object - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
document_json: The document as a JSON object - String - required
admin
couchbase put "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "c001" "{\"name\": \"Zoé\", \"city\": \"Paris\", \"age\": 31, \"tags\": [\"vip\"]}"
mentdb
{"id": "c001"}
couchbase put <config> <keyspace> <id> <document_json> <options_json>
Description
Write one document with options: expiry (seconds before the document expires, 50 years at most; beyond 30 days it is sent as an absolute Unix time, as Couchbase requires)
Write one document with options: expiry (seconds before the document expires, 50 years at most; beyond 30 days it is sent as an absolute Unix time, as Couchbase requires)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
document_json: The document as a JSON object - String - required
options_json: The options - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
document_json: The document as a JSON object - String - required
options_json: The options - String - required
admin
couchbase put "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.sessions" "s-42" "{\"user\": \"c001\"}" "{\"expiry\": 3600}"
mentdb
{"id": "s-42"}
couchbase get <config> <keyspace> <id>
Description
Read one document by its key; null when it does not exist
Read one document by its key; null when it does not exist
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
admin
couchbase get "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "c001"
mentdb
{"age": 31, "city": "Paris", "name": "Zoé", "tags": ["vip"]}
no such key (fixed result: real Couchbase Server Community 7.6.2)
admin
couchbase get "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "nothing"
mentdb
null
couchbase insert <config> <keyspace> <rows_json>
Description
Insert MQL rows (a JSON array of objects): the key of each document is its id field. A key which exists already is an error of the list, the other documents are written. Returns {inserted, errors}
Insert MQL rows (a JSON array of objects): the key of each document is its id field. A key which exists already is an error of the list, the other documents are written. Returns {inserted, errors}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
rows_json: The rows as a JSON array of objects - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
rows_json: The rows as a JSON array of objects - String - required
admin
couchbase insert "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "[{\"id\": \"c002\", \"name\": \"Marc\", \"city\": \"Lyon\", \"age\": 45}, {\"id\": \"c003\", \"name\": \"Ana\", \"city\": \"Paris\", \"age\": 28}]"
mentdb
{"inserted": 2, "errors": []}
a key which exists already (fixed result: real Couchbase Server Community 7.6.2)
admin
couchbase insert "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "[{\"id\": \"c003\", \"name\": \"Ana\"}, {\"id\": \"c004\", \"name\": \"Léa\", \"city\": \"Saint-Denis\", \"age\": 52}]"
mentdb
{"inserted": 1, "errors": ["12009: DML Error, possible causes include concurrent modification. Failed to perform INSERT on key c003 - cause: Duplicate Key: c003"]}
couchbase insert <config> <keyspace> <rows_json> <options_json>
Description
Insert rows with options: id_field (id), keep_id (true: the id field stays in the document), mode (insert, or upsert to replace the existing documents), expiry (seconds)
Insert rows with options: id_field (id), keep_id (true: the id field stays in the document), mode (insert, or upsert to replace the existing documents), expiry (seconds)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
rows_json: The rows as a JSON array of objects - String - required
options_json: The options - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
rows_json: The rows as a JSON array of objects - String - required
options_json: The options - String - required
admin
couchbase insert "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.sessions" "[{\"code\": \"s-43\", \"user\": \"c002\"}, {\"code\": \"s-44\", \"user\": \"c003\"}]" "{\"id_field\": \"code\", \"keep_id\": false, \"mode\": \"upsert\"}"
mentdb
{"inserted": 2, "errors": []}
couchbase find <config> <keyspace> <filter_json>
Description
The documents of a filter: rows with the key in _id and the fields of the document, 1000 rows at most
The documents of a filter: rows with the key in _id and the fields of the document, 1000 rows at most
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
admin
couchbase find "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "{\"city\": \"Paris\"}"
mentdb
[{"_id": "c001", "age": 31, "city": "Paris", "name": "Zoé", "tags": ["vip"]}, {"_id": "c003", "age": 28, "city": "Paris", "id": "c003", "name": "Ana"}]
couchbase find <config> <keyspace> <filter_json> <options_json>
Description
Find with options: limit (1000), skip, sort ({"age": -1} or ["name", "-age"]), fields (the fields to return, _id is always there), scan_consistency (request_plus; not_bounded is faster but may miss the last writes)
Find with options: limit (1000), skip, sort ({"age": -1} or ["name", "-age"]), fields (the fields to return, _id is always there), scan_consistency (request_plus; not_bounded is faster but may miss the last writes)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
options_json: The options - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
options_json: The options - String - required
admin
couchbase find "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "{\"age\": {\"$gte\": 30}}" "{\"fields\": [\"name\", \"age\"], \"sort\": {\"age\": -1}, \"limit\": 2}"
mentdb
[{"_id": "c004", "name": "Léa", "age": 52}, {"_id": "c002", "name": "Marc", "age": 45}]
by keys (fixed result: real Couchbase Server Community 7.6.2)
admin
couchbase find "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "{\"_id\": {\"$in\": [\"c001\", \"c004\"]}}" "{\"fields\": [\"name\"], \"sort\": [\"_id\"]}"
mentdb
[{"_id": "c001", "name": "Zoé"}, {"_id": "c004", "name": "Léa"}]
couchbase count <config> <keyspace>
Description
The number of documents of a collection
The number of documents of a collection
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
admin
couchbase count "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers"
mentdb
4
couchbase count <config> <keyspace> <filter_json>
Description
The number of documents of a filter
The number of documents of a filter
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
admin
couchbase count "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "{\"city\": \"Paris\"}"
mentdb
2
couchbase update <config> <keyspace> <filter_json> <changes_json>
Description
Set fields on the documents of a filter. A dotted path (address.zip) sets a field inside an existing object: a missing parent object is not created (set the parent object instead, like {"address": {"zip": "75001"}}). Returns {matched, modified} (both the number of documents written)
Set fields on the documents of a filter. A dotted path (address.zip) sets a field inside an existing object: a missing parent object is not created (set the parent object instead, like {"address": {"zip": "75001"}}). Returns {matched, modified} (both the number of documents written)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
changes_json: The fields to set as a JSON object - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
changes_json: The fields to set as a JSON object - String - required
admin
couchbase update "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "{\"city\": \"Paris\"}" "{\"segment\": \"vip\"}"
mentdb
{"matched": 2, "modified": 2}
couchbase update <config> <keyspace> <filter_json> <changes_json> <options_json>
Description
Update with options: unset (fields to remove), limit
Update with options: unset (fields to remove), limit
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
changes_json: The fields to set as a JSON object - String - required
options_json: The options - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
changes_json: The fields to set as a JSON object - String - required
options_json: The options - String - required
admin
couchbase update "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "{\"_id\": \"c001\"}" "{\"address.zip\": \"75001\"}" "{\"unset\": [\"tags\"]}"
mentdb
{"matched": 1, "modified": 1}
couchbase query <config> <statement>
Description
Run a SQL++ statement: the rows (a JSON array; SELECT RAW gives an array of values). 100000 rows at most
Run a SQL++ statement: the rows (a JSON array; SELECT RAW gives an array of values). 100000 rows at most
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
admin
couchbase query "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "SELECT c.city, COUNT(*) AS n FROM shop.sales.customers AS c GROUP BY c.city ORDER BY c.city"
mentdb
[{"city": "Lyon", "n": 1}, {"city": "Paris", "n": 2}, {"city": "Saint-Denis", "n": 1}]
couchbase query <config> <statement> <json_params>
Description
Run a SQL++ statement with parameters: args (a JSON array for $1, $2... or an object for $name), scan_consistency (not_bounded or request_plus), query_context (bucket.scope: the collections can be named alone), readonly (true: a write is refused), max_rows (100000, 1000000 at most)
Run a SQL++ statement with parameters: args (a JSON array for $1, $2... or an object for $name), scan_consistency (not_bounded or request_plus), query_context (bucket.scope: the collections can be named alone), readonly (true: a write is refused), max_rows (100000, 1000000 at most)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
json_params: The parameters - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
json_params: The parameters - String - required
admin
couchbase query "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "SELECT RAW name FROM customers WHERE age > $min ORDER BY name" "{\"args\": {\"min\": 30}, \"query_context\": \"shop.sales\", \"scan_consistency\": \"request_plus\"}"
mentdb
["Léa", "Marc", "Zoé"]
positional parameter (fixed result: real Couchbase Server Community 7.6.2)
admin
couchbase query "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "SELECT RAW name FROM shop.sales.customers WHERE city = $1 ORDER BY name" "{\"args\": [\"Paris\"]}"
mentdb
["Ana", "Zoé"]
couchbase execute <config> <statement>
Description
Run a SQL++ statement and return its status: {status, mutation_count, result_count, rows} (and warnings). For INSERT, UPDATE, DELETE, MERGE, CREATE INDEX...
Run a SQL++ statement and return its status: {status, mutation_count, result_count, rows} (and warnings). For INSERT, UPDATE, DELETE, MERGE, CREATE INDEX...
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
admin
couchbase execute "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "UPDATE shop.sales.customers SET seen = true WHERE city = \"Lyon\""
mentdb
{"status": "success", "mutation_count": 1, "result_count": 0, "rows": []}
couchbase execute <config> <statement> <json_params>
Description
Run a SQL++ statement with parameters (same as couchbase query)
Run a SQL++ statement with parameters (same as couchbase query)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
json_params: The parameters - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
statement: The SQL++ (N1QL) statement, with $1, $2... or $name parameters - String - required
json_params: The parameters - String - required
admin
couchbase execute "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "UPDATE shop.sales.customers SET age = age + 1 WHERE META().id = $1 RETURNING META().id, age" "{\"args\": [\"c002\"]}"
mentdb
{"status": "success", "mutation_count": 1, "result_count": 1, "rows": [{"id": "c002", "age": 46}]}
couchbase delete <config> <keyspace> <id>
Description
Delete one document by its key. Returns {deleted} (0 when the key does not exist)
Delete one document by its key. Returns {deleted} (0 when the key does not exist)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
id: The key of the document (250 bytes at most) - String - required
admin
couchbase delete "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "c002"
mentdb
{"deleted": 0}
couchbase delete_where <config> <keyspace> <filter_json>
Description
Delete the documents of a filter (an empty filter is refused: use couchbase query with DELETE FROM). Returns {deleted}
Delete the documents of a filter (an empty filter is refused: use couchbase query with DELETE FROM). Returns {deleted}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
filter_json: The filter as a JSON object: {"city": "Paris"} (equality), {"age": {"$gte": 18}} with $eq $ne $gt $gte $lt $lte $in $nin $like $exists, a dotted path for a nested field (address.zip), _id for the key of the document; {} for every document - String - required
admin
couchbase delete_where "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.customers" "{\"segment\": \"vip\"}"
mentdb
{"deleted": 2}
couchbase request <config> <method> <path>
Description
A raw HTTP request (escape hatch): /query/... and /admin/... go to the Query service, the other paths to the management REST API. Returns the body of the answer ({status} when it is empty)
A raw HTTP request (escape hatch): /query/... and /admin/... go to the Query service, the other paths to the management REST API. Returns the body of the answer ({status} when it is empty)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
method: GET, POST, PUT, DELETE, PATCH or HEAD - String - required
path: The path, like /pools/default/buckets - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
method: GET, POST, PUT, DELETE, PATCH or HEAD - String - required
path: The path, like /pools/default/buckets - String - required
admin
couchbase request "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "GET" "/admin/ping"
mentdb
{"status":"OK"}
couchbase request <config> <method> <path> <body>
Description
A raw HTTP request with a body (JSON, or a form like name=value&name2=value2)
A raw HTTP request with a body (JSON, or a form like name=value&name2=value2)
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
method: GET, POST, PUT, DELETE, PATCH or HEAD - String - required
path: The path - String - required
body: The body - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
method: GET, POST, PUT, DELETE, PATCH or HEAD - String - required
path: The path - String - required
body: The body - String - required
admin
couchbase request "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "POST" "/query/service" "statement=SELECT RAW 6*7"
mentdb
{ "requestID": "54f5019d-3c0f-4da4-9b91-3805b28565f0", "signature": "number", "results": [ 42 ], "status": "success", "metrics": {"elapsedTime": "326.916µs","executionTime": "275.541µs","resultCount": 1,"resultSize": 2,"serviceLoad": 6} }
couchbase collection_drop <config> <keyspace>
Description
Drop a collection and its documents (not a default collection). Returns {dropped}
Drop a collection and its documents (not a default collection). Returns {dropped}
Parameters
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
config: The Couchbase configuration as JSON: host (127.0.0.1), username and password (the name of a secret: secret set), tls (false; true: https on 18091 and 18093, certificate and host name checked), management_port (8091, 18091 with tls), query_port (8093, 18093 with tls), ca_file (a PEM file of the private CA of the cluster, with tls), allow_plain (false: a password without tls is refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
keyspace: The collection: bucket.scope.collection, or a bucket alone for its default collection; a part with a dot is back-quoted (`my.bucket`.scope.collection) - String - required
admin
couchbase collection_drop "{\"host\": \"127.0.0.1\", \"username\": \"Administrator\", \"password\": \"cb_password\"}" "shop.sales.sessions"
mentdb
{"dropped": "shop.sales.sessions"}
