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 可用的选项:
| 属性 | 名称 | 描述 | 类型 | 默认 | 示例 |
|---|---|---|---|---|---|
| collection * | MongoDB Collection | 设置要绑定到此端点的 MongoDB 集合的名称。 | 字符串 | ||
| Database * | MongoDB 数据库 | 将 MongoDB 数据库的名称设置为 target。 | 字符串 | ||
| Hosts * | MongoDB 主机 | 以 host:port 格式以逗号分隔的 MongoDB 主机地址列表。 | 字符串 | ||
| createCollection | 集合 | 如果集合不存在,请在初始期间创建集合。 | 布尔值 |
| |
| password | MongoDB 密码 | 用于访问 MongoDB 的用户密码。 | 字符串 | ||
| username | MongoDB 用户名 | 用于访问 MongoDB 的用户名。 | 字符串 | ||
| writeConcern | 写 Concern | 为写操作配置从 MongoDB 请求的确认级别,可能的值有 ACKNOWLEDGED、W1, W2, W3, UNACKNOWLEDGED, JOURNALED, MAJORITY。 | 字符串 |
标有星号 integrity 的字段是必需的。