Couchbase Datasource Integration

Knowi enables data discovery, query, aggregation, visualization and reporting automation from Couchbase along with other unstructured and structured datasources.

  • Native Couchbase Analytics
  • Supports N1QL and Couchbase Analytics Service
  • Blend Couchbase Buckets, other NoSQL or Relational Data Sources
  • Natural Language BI on Couchbase
  • Embed Analytics into Your Couchbase Powered Data Applications
  • Monitor datasets for conditions you specify and automatically send notifications or push data to other systems when those conditions are met.


  1. Connect, extract and transform data from your Couchbase database, using one of the following options:

    a. Through our UI to connect directly.
    b. Using our Cloud9Agent. This can securely pull data inside your network. See agent configuration for more details.

  2. Visualize and Automate your Reporting instantly.

UI Based Approach


  1. Log in to Knowi and select Queries from the left sidebar.
  2. Click on the New Datasource + button and select Couchbase from the list of datasources.
  3. After navigating to the New Datasource page, either use the pre-configured settings into Cloud9 Chart's own demo Couchbase database or follow the prompts and configure the following details to set up connectivity to your own Couchbase database:

    a. Datasource Name: Enter a name for your datasource
    b. Host Name: Enter the host name to connect to
    c. Bucket Name: Enter the bucket name
    d. Dataverse: Dataverse Name. Set this value if you would like this datasource to connect to Couchbase Analytics
    e. User ID: Enter the User ID to connect
    f. Password: Enter the password to connect to the bucket
    g. Database Properties: Additional database connection properties. For example, ssl=true

  4. Click on the Test Connection to confirm successful connection to the Couchbase database, hit the Save button, and start Querying.

Couchbase Connect


Step 1: Query using a visual builder or query editor

Visual Builder: After connecting to the Couchbase datasource, Knowi will pull out a list of buckets along with field samples. Using these buckets, you can automatically generate queries through our visual builder in a no-code environment by either dragging and dropping fields or making your selections through the drop-down.

Couchbase Data Discovery

Tip: You can also write queries directly in the Query Editor, a versatile text editor that offers more advanced editing functionalities like N1QL Query, support for multiple language modes, Cloud9QL, and more.

Furthermore, you can also use the Format button in the query editor to auto-format the query text for indentation, spaces, and more.

format couchbase

Step 2: Define data execution strategy by using any of the following two options:

  • Direct Execution: Directly execute the Query on the original Datasource, without any storage in between. In this case, when a widget is displayed, it will fetch the data in real time from the underlying Datasource.

  • Non-Direct Execution: For non-direct queries, results will be stored in Knowi?s Elastic Store. Benefits include- long-running queries, reduced load on your database, and more.

Non-direct execution can be put into action if you choose to run the Query once or at scheduled intervals. For more information, feel free to check out this documentation- Defining Data Execution Strategy

Couchbase Data Strategy

Step 3: Click on the Preview button to analyze the results of your Query and fine-tune the desired output, if required.

Couchbase Data Discovery

The result of your Query is called Dataset. After reviewing the results, name your dataset and then hit the Create & Run button.

Create and Run

Cloud9Agent Configuration

As an alternative to the UI based connectivity above, you can use Cloud9Agent inside your network to pull from Couchbase securely. See Cloud9Agent to download your agent along with instructions to run it.


  • Pull data using N1QL.
  • Execute queries on a schedule, or, one time.

The agent contains a datasource_example_couchbase.json and query_example_couchbase.json under the examples folder of the agent installation to get you started.

  • Edit those to point to your database and modify the queries to pull your data.
  • Move it into the config directory (datasource_XXX.json files first if the Agent is running).

Datasource Configuration:

Parameter Comments
name Unique Datasource Name.
datasource Set value to couchbase
host Host to connect to. Example:
dbName Database Name
password Password to connect with

Query Configuration:

Query Config Params Comments
entityName Dataset Name Identifier
identifier A unique identifier for the dataset. Either identifier or entityName must be specified.
dsName Name of the datasource name configured in the datasource_XXX.json file to execute the query against. Required.
queryStr Couchbase N1QL query to execute. Required.
frequencyType One of minutes, hours, days,weeks,months. If this is not specified, this is treated as a one time query, executed upon Cloud9Agent startup (or when the query is first saved)
frequency Indicates the frequency, if frequencyType is defined. For example, if this value is 10 and the frequencyType is minutes, the query will be executed every 10 minutes
startTime Optional, can be used to specify when the query should be run for the first time. If set, the the frequency will be determined from that time onwards. For example, is a weekly run is scheduled to start at 07/01/2014 13:30, the first run will run on 07/01 at 13:30, with the next run at the same time on 07/08/2014. The time is based on the local time of the machine running the Agent. Supported Date Formats: MM/dd/yyyy HH:mm, MM/dd/yy HH:mm, MM/dd/yyyy, MM/dd/yy, HH:mm:ss,HH:mm,mm
c9QLFilter Optional post processing of the results using Cloud9QL.
overrideVals This enables data storage strategies to be specified. If this is not defined, the results of the query is added to the existing dataset. To replace all data for this dataset within Knowi, specify {"replaceAll":true}. To upsert data specify "replaceValuesForKey":["fieldA","fieldB"]. This will replace all existing records in Knowi with the same fieldA and fieldB with the the current data and insert records where they are not present.


Datasource Example:

       "name": "demoCouchbase",
       "host": "",
       "dbName": "",
       "password": "",
       "datasource": "couchbase"


Query Examples:

      "entityName": "Couchbase Demo",
      "queryStr": "select `brewery_id`, avg(`abv`), count(`name`) from `beer-sample` where `type` = \"beer\" group by `brewery_id` limit 10000",
      "c9QLFilter": "",
      "dsName": "demoCouchbase",
      "overrideVals": {
          "replaceAll": true

The query is run every 10 minutes at the top of the hour and replaces all data for that dataset in Knowi.