# couchbase

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: couchbase
latest-connect-version: 4.93.0
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-redpanda-tag: v26.1.9
docname: outputs/couchbase
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: outputs/couchbase.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/outputs/couchbase.adoc
page-git-created-date: "2024-10-16"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/connect/components/outputs/couchbase.md -->

**Type:** Output ▼

[Output](https://docs.redpanda.com/connect/components/outputs/couchbase/)[Cache](https://docs.redpanda.com/connect/components/caches/couchbase/)[Processor](https://docs.redpanda.com/connect/components/processors/couchbase/)

**Available in:** Self-Managed

Perform operations on a [Couchbase database](https://docs.couchbase.com/home/index.html) for each incoming message. This connector can store or delete data in Couchbase based on the message’s content.

Introduced in version 4.37.0.

#### Common

```yml
outputs:
  label: ""
  couchbase:
    url: "" # No default (required)
    username: "" # No default (optional)
    password: "" # No default (optional)
    bucket: "" # No default (required)
    id: "" # No default (required)
    content: "" # No default (optional)
    operation: upsert
    max_in_flight: 64
    batching:
      count: 0
      byte_size: 0
      period: ""
      check: ""
      processors: [] # No default (optional)
```

#### Advanced

```yml
outputs:
  label: ""
  couchbase:
    url: "" # No default (required)
    username: "" # No default (optional)
    password: "" # No default (optional)
    bucket: "" # No default (required)
    collection: "" # No default (optional)
    scope: "" # No default (optional)
    transcoder: legacy
    timeout: 15s
    id: "" # No default (required)
    content: "" # No default (optional)
    ttl: "" # No default (optional)
    operation: upsert
    max_in_flight: 64
    batching:
      count: 0
      byte_size: 0
      period: ""
      check: ""
      processors: [] # No default (optional)
```

## [](#performance)Performance

For improved performance, this output sends multiple messages in parallel. You can tune the maximum number of in-flight messages (or message batches), using the `max_in_flight` field.

You can configure batches at both the input and output level. For more information, see [Message Batching](https://docs.redpanda.com/connect/configuration/batching/).

## [](#fields)Fields

### [](#batching)`batching`

Configure a [batching policy](https://docs.redpanda.com/connect/configuration/batching/).

**Type**: `object`

```yaml
# Examples:
batching:
  byte_size: 5000
  count: 0
  period: 1s

# ---

batching:
  count: 10
  period: 1s

# ---

batching:
  check: this.contains("END BATCH")
  count: 0
  period: 1m
```

### [](#batching-byte_size)`batching.byte_size`

The number of bytes at which the batch is flushed. Set to `0` to disable size-based batching.

**Type**: `int`

**Default**: `0`

### [](#batching-check)`batching.check`

A [Bloblang query](https://docs.redpanda.com/connect/guides/bloblang/about/) that returns a boolean value indicating whether a message should end a batch.

**Type**: `string`

**Default**: `""`

```yaml
# Examples:
check: this.type == "end_of_transaction"
```

### [](#batching-count)`batching.count`

The number of messages after which the batch is flushed. Set to `0` to disable count-based batching.

**Type**: `int`

**Default**: `0`

### [](#batching-period)`batching.period`

The period of time after which an incomplete batch is flushed regardless of its size. This field accepts Go duration format strings such as `100ms`, `1s`, or `5s`.

**Type**: `string`

**Default**: `""`

```yaml
# Examples:
period: 1s

# ---

period: 1m

# ---

period: 500ms
```

### [](#batching-processors)`batching.processors[]`

A list of [processors](https://docs.redpanda.com/connect/components/processors/about/) to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. All resulting messages are flushed as a single batch, and therefore splitting the batch into smaller batches using these processors is a no-op.

**Type**: `processor`

```yaml
# Examples:
processors:
  - archive:
      format: concatenate

# ---

processors:
  - archive:
      format: lines

# ---

processors:
  - archive:
      format: json_array
```

### [](#bucket)`bucket`

The name of the Couchbase bucket you want the output to access.

**Type**: `string`

### [](#collection)`collection`

The name of the specific collection you want the output to write to.

**Type**: `string`

### [](#content)`content`

The document content to update. When inserting, replacing, or upserting documents, you must set a `content` value.

**Type**: `string`

### [](#id)`id`

The document ID to use.

This field supports [interpolation functions](https://docs.redpanda.com/connect/configuration/interpolation/#bloblang-queries).

**Type**: `string`

```yaml
# Examples:
id: ${! json("id") }
```

### [](#max_in_flight)`max_in_flight`

The maximum number of messages to have in flight at a given time. Increase this value to improve throughput.

**Type**: `int`

**Default**: `64`

### [](#operation)`operation`

The Couchbase operation to perform.

**Type**: `string`

**Default**: `upsert`

| Option | Summary |
| --- | --- |
| insert | insert a new document. |
| remove | delete a document. |
| replace | replace the contents of a document. |
| upsert | creates a new document if it does not exist, if it does exist then it updates it. |

### [](#password)`password`

A password to authenticate with the Couchbase cluster.

> ⚠️ **CAUTION**
>
> This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see [Secrets](https://docs.redpanda.com/connect/configuration/secrets/).

**Type**: `string`

### [](#scope)`scope`

Bucket scope.

**Type**: `string`

### [](#timeout)`timeout`

Operation timeout if this output cannot connect to the Couchbase cluster.

**Type**: `string`

**Default**: `15s`

### [](#transcoder)`transcoder`

Choose from the following Couchbase transcoders to convert the messages' data format before they are written to Couchbase.

**Type**: `string`

**Default**: `legacy`

| Option | Summary |
| --- | --- |
| json | JSONTranscoder implements the default transcoding behavior and applies JSON transcoding to all values. This will apply the following behavior to the value: binary ([]byte) → error. default → JSON value, JSON Flags. |
| legacy | LegacyTranscoder implements the behavior for a backward-compatible transcoder. This transcoder implements behavior matching that of gocb v1.This will apply the following behavior to the value: binary ([]byte) → binary bytes, Binary expectedFlags. string → string bytes, String expectedFlags. default → JSON value, JSON expectedFlags. |
| raw | RawBinaryTranscoder implements passthrough behavior of raw binary data. This transcoder does not apply any serialization. This will apply the following behavior to the value: binary ([]byte) → binary bytes, binary expectedFlags. default → error. |
| rawjson | RawJSONTranscoder implements passthrough behavior of JSON data. This transcoder does not apply any serialization. It will forward data across the network without incurring unnecessary parsing costs. This will apply the following behavior to the value: binary ([]byte) → JSON bytes, JSON expectedFlags. string → JSON bytes, JSON expectedFlags. default → error. |
| rawstring | RawStringTranscoder implements passthrough behavior of raw string data. This transcoder does not apply any serialization. This will apply the following behavior to the value: string → string bytes, string expectedFlags. default → error. |

### [](#ttl)`ttl`

An optional TTL to set for items.

**Type**: `string`

### [](#url)`url`

The Couchbase connection string.

**Type**: `string`

```yaml
# Examples:
url: couchbase://localhost:11210
```

### [](#username)`username`

A username to authenticate with the Couchbase cluster.

**Type**: `string`