Implementation
This handler is implemented using thecouchbase
library, the Python driver for Couchbase.
The required arguments to establish a connection are as follows:
host
: the host name or IP address of the Couchbase serverbucket
: the bucket name to use when connecting with the Couchbase serveruser
: the user to authenticate with the Couchbase serverpassword
: the password to authenticate the user with the Couchbase serverscope
: scopes are a level of data organization within a bucket. If omitted, will default to_default
If you are using Couchbase Capella, the
host
should be the connection string for the cluster. When you navigate to your cluster, the connection string can be found under the Connect tab.
It will also be required to whitelist the machine(s) that will be running MindsDB and database credentials will need to be created for the user. These steps can also be taken under the Connect tab.If you installed MindsDB locally via pip, you need to install all handler dependencies manually. To do so, go to the handler’s folder (mindsdb/integrations/handlers/couchbase_handler) and run this command:
pip install -r requirements.txt
.Usage
In order to make use of this handler and connect to a Couchbase server in MindsDB, the following syntax can be used. Note, that the example uses the defaulttravel-sample
bucket which can be enabled from the couchbase UI with pre-defined scope and documents.