Red Hat Camel K is no longer supported.
As of June 30, 2025, Red Hat build of Camel K has reached End of Life. The suggested replacements is Red Hat build of Apache Camel. For details about moving, see the Camel K to Camel Quarkus migration guide.第 51 章 MongoDB Sink
将文档发送到 MongoDB。
此 Kamelet 需要 JSON 作为正文。
属性可以设置为标头:
-
db-upsert
/ce-dbupsert
:如果数据库应创建元素(如果不存在的话)。布尔值.
51.1. 配置选项 复制链接链接已复制到粘贴板!
下表总结了 mongodb-sink
Kamelet 可用的配置选项:
属性 | 名称 | 描述 | 类型 | 默认 | 示例 |
---|---|---|---|---|---|
集合 (集合) | MongoDB Collection | 设置要绑定到此端点的 MongoDB 集合的名称。 | 字符串 | ||
数据库 (数据库) | MongoDB Database | 将 MongoDB 数据库的名称设置为 target。 | 字符串 | ||
主机 X | MongoDB Hosts | 以逗号分隔的 MongoDB Host Addresses 列表,格式为 host:port。 | 字符串 | ||
createCollection | 集合 | 在初始时创建集合(如果不存在)。 | 布尔值 |
| |
password | MongoDB 密码 | 用于访问 MongoDB 的用户密码。 | 字符串 | ||
username | MongoDB Username | 用于访问 MongoDB 的用户名。 | 字符串 | ||
writeConcern | 写 Concern | 为写入操作配置 MongoDB 请求的确认级别,可能的值是 ACKNOWLEDGED, W1, W2, W3, UNACKNOWLEDGED, JOURNALED, MAJORITY。 | 字符串 |
带有星号 packagemanifests 的字段是必需的。