Skip to main content

couchbase

EXPERIMENTAL

This component is experimental and therefore subject to change or removal outside of major version releases.

Performs operations against Couchbase for each message, allowing you to store or retrieve data within message payloads.

Introduced in version 1.0.0.

# Common config fields, showing default values
label: ""
couchbase:
url: couchbase://localhost:11210 # No default (required)
username: "" # No default (optional)
password: "" # No default (optional)
bucket: "" # No default (required)
id: ${! json("id") } # No default (required)
content: "" # No default (optional)
operation: get
cas_enabled: true

When inserting, replacing or upserting documents, each must have the content property set.

Concurrent Document Mutations

To prevent read/write conflicts, Couchbase returns a Compare And Swap (CAS) value with each accessed document. Bento stores these as key/value pairs in metadata with the couchbase_cas field. Note: CAS checks are enabled by default. You can configure this by changing the value of cas_enabled: false.

Fields

url

Couchbase connection string.

Type: string

# Examples

url: couchbase://localhost:11210

username

Username to connect to the cluster.

Type: string

password

Password to connect to the cluster.

Secret

This field contains sensitive information that usually shouldn't be added to a config directly, read our secrets page for more info.

Type: string

bucket

Couchbase bucket.

Type: string

collection

Bucket collection.

Type: string
Default: "_default"

transcoder

Couchbase transcoder to use.

Type: string
Default: "legacy"

OptionSummary
jsonJSONTranscoder 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.
legacyLegacyTranscoder implements the behaviour for a backward-compatible transcoder. This transcoder implements behaviour 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.
rawRawBinaryTranscoder 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.
rawjsonRawJSONTranscoder 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.
rawstringRawStringTranscoder 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.

timeout

Operation timeout.

Type: string
Default: "15s"

id

Document id. This field supports interpolation functions.

Type: string

# Examples

id: ${! json("id") }

content

Document content.

Type: string

operation

Couchbase operation to perform.

Type: string
Default: "get"

OptionSummary
getfetch a document.
insertinsert a new document.
removedelete a document.
replacereplace the contents of a document.
upsertcreates a new document if it does not exist, if it does exist then it updates it.

cas_enabled

Enable CAS validation.

Type: bool
Default: true