Overview
You can set configuration properties to specify how the MongoDB Kafka sink connector writes data into MongoDB. The following sections describe the configuration properties that you can set to customize this behavior.
Write Model
Set the writemodel.strategy configuration property to specify how the sink connector writes data when it receives a sink record.
You can set the value of writemodel.strategy to any of the fully qualified class names of the write model strategies described in the Strategies section of this page. You can specify a strategy by setting the following configuration:
writemodel.strategy=<a write model strategy>
Delete Write Model
Set the delete.writemodel.strategy configuration property to specify how the sink connector writes data when it receives a tombstone event. A tombstone event is a record that contains a key but no value, which signifies a deleted record.
You can set the value of delete.writemodel.strategy to any of the fully qualified class names of the write model strategies described in the Strategies section of this page. You can specify a strategy by setting the following configuration:
delete.writemodel.strategy=<a write model strategy>
For a list of sink connector configuration settings organized by category, see the guide on Sink Connector Configuration Properties.
Strategies
Name | Description | |
|---|---|---|
DefaultWriteModelStrategy | Description: | |
InsertOneDefaultStrategy | Description: | |
ReplaceOneDefaultStrategy | Description: | |
ReplaceOneBusinessKeyStrategy | Description: To see an example showing how to use this strategy, see our guide on write model strategies. | |
DeleteOneDefaultStrategy | Description: | |
DeleteOneBusinessKeyStrategy | Description: To see an example showing how to use this strategy, see our guide on write model strategies. | |
DeleteOneTombstoneBusinessKeyStrategy | Description: | |
UpdateOneDefaultStrategy | Description: | |
UpdateOneTimestampsStrategy | Description: To see an example showing how to use this strategy, see our guide on write model strategies. | |
UpdateOneBusinessKeyTimestampStrategy | Description: |