couchbase
Perform operations on a Couchbase database 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
-
Advanced
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)
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
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.
Fields
batching
Configure a batching policy.
Type: object
# 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
The number of bytes at which the batch is flushed. Set to 0 to disable size-based batching.
Type: int
Default: 0
batching.check
A Bloblang query that returns a boolean value indicating whether a message should end a batch.
Type: string
Default: ""
# Examples:
check: this.type == "end_of_transaction"
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
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: ""
# Examples:
period: 1s
# ---
period: 1m
# ---
period: 500ms
batching.processors[]
A list of processors 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
# Examples:
processors:
- archive:
format: concatenate
# ---
processors:
- archive:
format: lines
# ---
processors:
- archive:
format: json_array
content
The document content to update. When inserting, replacing, or upserting documents, you must set a content value.
Type: string
id
The document ID to use.
This field supports interpolation functions.
Type: string
# Examples:
id: ${! json("id") }
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
The Couchbase operation to perform.
Type: string
Default: upsert
| Option | Summary |
|---|---|
|
insert a new document. |
|
delete a document. |
|
replace the contents of a document. |
|
creates a new document if it does not exist, if it does exist then it updates it. |
password
A password to authenticate with the Couchbase cluster.
|
This field contains sensitive information that usually shouldn’t be added to a configuration directly. For more information, see Secrets. |
Type: string
timeout
Operation timeout if this output cannot connect to the Couchbase cluster.
Type: string
Default: 15s
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 |
|---|---|
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |