对于AI助手:文档索引位于 https://www.mongodb.com/zh-cn/docs/llms.txt — 通过将 .md 附加到任何URL路径,可以获得所有页面的降价版本。
Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
Docs 菜单

接收器 Connector Id 策略属性

使用以下配置设置,指定 MongoDB Kafka Sink 连接器应如何确定写入 MongoDB 的每个文档的 _id 值。

有关按类别组织的接收器连接Connector配置设置列表,请参阅接收器连接器配置属性指南。

名称
说明

document.id.strategy

类型:字符串

描述:Connector用于生成唯一
_id字段的类。默认值:

com.mongodb.kafka.connect.sink.processor.id.strategy.BsonOidStrategy

接受的值:空字符串或完全限定的 Java 类名

document.id.strategy.overwrite.existing

类型:布尔值 描述:Connector在应用


属性定义的策略时是否应覆盖_id document.id.strategy字段中的现有值。默认值:

false
接受值:truefalse

document.id.strategy.uuid.format

类型:字符串 描述:Connector应以字符串格式还是


_idBsonBinary 格式在 字段中输出 UUID。默认值:

string
接受值:stringbinary

delete.on.null.values

类型:布尔值


描述:当键值与MongoDB中的文档匹配且值字段为 null 时,Connector是否应删除文档。当您指定对密钥文档进行操作的

ID 生成策略(例如FullKeyStrategy 、 和 )时,此设置适用。默认值:PartialKeyStrategy ProvidedInKeyStrategy

false
接受值:truefalse

在此页面上