对于 AI 代理:可在 https://www.mongodb.com/zh-cn/docs/llms.txt 获取文档索引—通过在任何 URL 路径后添加 .md 可获取所有页面的 Markdown 版本。
Docs 菜单

Kafka 时间序列属性

使用以下配置设置指定 MongoDB Kafka 接收器连接器应如何将数据接收到 MongoDB 时间序列集合。

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

名称
说明

timeseries.timefield

类型:string

说明:
源数据中的顶级字段的名称,其中包含要与时间序列集合中的新文档关联的时间信息。

默认:""
可接受值:空字符串或包含 BSON DateTime 值的字段的名称

timeseries.timefield.auto.convert.date.format

类型:string

说明:
连接器应用于转换 timeseries.timefield 设置指定的字段中包含的源数据的日期格式模式。

连接器将日期格式模式传递给 Java DateTimeFormatter.ofPattern(pattern, locale) 方法,以对时间字段进行日期和时间转换。

如果源数据中的日期值只包含日期信息,连接器会将时间信息设置为指定日的开始。如果日期值不包含时区偏移,连接器会将偏移设置为 UTC。

默认:

yyyy-MM-dd[['T'][ ]][HH:mm:ss[[.][SSSSSS][SSS]][ ]VV[ ]'['VV']'][HH:mm:ss[[.][SSSSSS][SSS]][ ]X][HH:mm:ss[[.][SSSSSS][SSS]]]

接受的值:有效的DateTimeFormatter格式

timeseries.timefield.auto.convert

类型:布尔值

说明:
是否将字段中的数据转换为 BSON Date 格式。

当设置为 true 时,连接器使用 Unix 纪元后的毫秒,并在值为数字时忽略小数部分。如果值为 string,连接器使用以下配置中的设置来解析日期:

timeseries.timefield.auto.convert.date.format

如果连接器无法转换该值,它会将原始值发送到时间序列集合。

默认:false
可接受值:true 或 false

timeseries.timefield.auto.convert.locale. language.tag

类型:string

说明:
要与日期格式模式一起使用的 DateTimeFormatter 区域设置语言标签(例如:"en-US")。

要了解有关区域设置的更多信息,请参阅 Java SE 文档中的 Locale。

默认值:ROOT
可接受值:有效的 Locale 语言标签格式

timeseries.metafield

类型: string

说明:
要从源数据中读取哪个顶级字段来描述一组相关的时间序列文档。

重要:此字段不得为 _id 字段,也不得为您在 timeseries.timefield 设置中指定的字段。

默认值:""
可接受值:空 string 或包含除 BsonArray 以外的任何 BSON 类型的字段名称。

timeseries.expire.after.seconds

Type: int

Description:
The number of seconds MongoDB should wait before automatically removing the time series collection data. The connector disables timed expiry when the setting value is less than 1.

To learn more, see Set up Automatic Removal for Time Series Collections in the MongoDB manual.

Default: 0
Accepted Values: An integer

timeseries.granularity

Type: string

Description:
The expected interval between subsequent measurements of your source data.

To learn more, see Set Granularity for Time Series Data in the MongoDB manual.

Optional
Default: ""
Accepted Values: "", "seconds", "minutes", "hours"

有关如何将现有集合转换为时间序列集合的示例,请参阅如何将现有集合迁移到时间序列集合的教程。

给本页内容打分

在此页面上