Docs Menu

Docs HomeMongoDB Kafka Connector

Kafka Time Series Properties

On this page

  • Overview
  • Settings

Use the following configuration settings to specify how the connector should sink data to a MongoDB time series collection.

For a list of sink connector configuration settings organized by category, see the guide on Sink Connector Configuration Properties.

Type: string

The name of the top-level field in the source data that contains time information that you want to associate with the new document in the time series collection.

Default: ""
Accepted Values: An empty string or the name of a field that contains a BSON DateTime value
Type: string

The date format pattern the connector should use to convert the source data contained in the field specified by the timeseries.timefield setting. The connector passes the date format pattern to the Java DateTimeFormatter.ofPattern(pattern, locale) method to perform date and time conversions on the time field.
If the date value from the source data only contains date information, the connector sets the time information to the start of the specified day. If the date value does not contain the timezone offset, the connector sets the offset to UTC.

yyyy-MM-dd[['T'][ ]][HH:mm:ss[[.][SSSSSS][SSS]][ ]VV[ ]'['VV']'][HH:mm:ss[[.][SSSSSS][SSS]][ ]X][HH:mm:ss[[.][SSSSSS][SSS]]]
Accepted Values: A valid DateTimeFormatter format
Type: boolean

Whether to convert the data in the field into the BSON Date format.
When set to true, the connector uses the milliseconds after epoch and discards fractional parts if the value is a number. If the value is a string, the connector uses the setting in the following configuration to parse the date:
If the connector fails to convert the value, it sends the original value to the time series collection.

Default: false
Accepted Values: true or false
Type: string

Which DateTimeFormatter locale language tag to use with the date format pattern (e.g. "en-US"). For more information on locales, see the Java SE documentation of Locale.

Default: ROOT
Accepted Values: A valid Locale language tag format
Type: string

Which top-level field to read from the source data to describe a group of related time series documents.


This field must not be the _id field nor the field you specified in the timeseries.timefield setting.

Default: ""
Accepted Values: An empty string or the name of a field that contains any BSON type except BsonArray.
Type: int

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. For more information on this collection setting, see the MongoDB Server Manual page on Automatic Removal for Time Series Collections.

Default: 0
Accepted Values: An integer
Type: string

The expected interval between subsequent measurements of your source data. For more information on this setting, see the MongoDB Server Manual page on Granularity for Time Series Data.

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

For an example on how to convert an existing collection to a time series collection, see the tutorial on how to Migrate an Existing Collection to a Time Series Collection.

←  Change Data Capture PropertiesAll Sink Connector Configuration Properties →

On this page