Overview
構成プロパティを設定して、MongoDB Kafka Sink Connector が MongoDB にデータを書込む方法を指定できます。 次のセクションでは、この動作をカスタマイズするために設定できる構成プロパティについて説明します。
書込みモデル
Sink Connector が Sink レコードを受信したときにデータを書込む方法を指定するには、  writemodel.strategy構成プロパティを設定します。
writemodel.strategyの値は、このページの戦略セクションで説明されている書込みモデル戦略の完全修飾クラス名のいずれかに設定できます。 次の構成を設定することで、戦略を指定できます。
writemodel.strategy=<a write model strategy> 
書込みモデルの削除
Sink Connector がトゥームストーン イベントを受信したときにデータを書き込む方法を指定するには、 delete.writemodel.strategy構成プロパティを設定します。 トゥームストーン イベントとは、キーを含むが値は含まないレコードであり、削除されたレコードを意味します。
delete.writemodel.strategyの値は、このページの「戦略」セクションで説明されている書込みモデル戦略の完全修飾クラス名のいずれかに設定できます。 次の構成を設定することで、戦略を指定できます。
delete.writemodel.strategy=<a write model strategy> 
カテゴリ別に整理された Sink Connector 構成設定のリストについては、 Sink Connector 構成プロパティ に関するガイドを参照してください。
Strategies
名前  | 説明  | |
|---|---|---|
DefaultWriteModelStrategy  | Description: This strategy uses the  ReplaceOneDefaultStrategy by
default, and the InsertOneDefaultStrategy if you set the
timeseries.timefield option.This is the default value value for the  writemodel.strategy
configuration property. | |
InsertOneDefaultStrategy  | Description: Insert each sink record into MongoDB as a document. To specify this strategy, set the configuration property to the
following class name:  | |
ReplaceOneDefaultStrategy  | Description: Replaces at most one document in MongoDB that matches a sink
record by the  _id field. If no documents match, the
connector inserts the sink record as a new document.To specify this strategy, set the configuration property to the
following class name:  | |
ReplaceOneBusinessKeyStrategy  | Description: Replaces at most one document that matches a sink record by a
specified business key. If no documents match, the
connector inserts the sink record as a new document. To specify this strategy, set the configuration property to the
following class name: To see an example showing how to use this strategy, see our
guide on write model strategies.  | |
DeleteOneDefaultStrategy  | Description: Deletes at most one document that matches your sink connector's
key structure by the  _id field only when the document
contains a null value structure.This is the default value for the
 delete.writemodel.strategy configuration property.This strategy is set as the default value of the
 writemodel.strategy property when you set
mongodb.delete.on.null.values=true.To specify this strategy, set the configuration property to the
following class name:  | |
DeleteOneBusinessKeyStrategy  | Description: Deletes at most one MongoDB document that matches a sink record by a business key. To specify this strategy, set the configuration property to the
following class name: To see an example showing how to use this strategy, see our
guide on write model strategies.  | |
UpdateOneDefaultStrategy  | Description: Updates at most one document in MongoDB that matches a sink
record by the  _id field. If no documents match, the
connector inserts the sink record as a new document.To specify this strategy, set the configuration property to the
following class name:  | |
UpdateOneTimestampsStrategy  | Description: Add  _insertedTS (inserted timestamp) and _modifiedTS (modified timestamp) fields into documents.To specify this strategy, set the configuration property to the
following class name: To see an example showing how to use this strategy, see our
guide on write model strategies.  | |
UpdateOneBusinessKeyTimestampStrategy  | Description: Add  _insertedTS (inserted timestamp) and _modifiedTS
(modified timestamp) fields into documents that match a business
key.To specify this strategy, set the configuration property to the
following class name:  |