Docs Menu
Docs Home
/
MongoDB Kafka Connector
/ /

싱크 커넥터 쓰기 모델 전략

이 페이지의 내용

  • 개요
  • Strategies

다음 표의 전략을 사용하여 MongoDB Kafka 싱크 connector 가 MongoDB 에 데이터를 쓰는 방법을 지정합니다. 다음 구성을 사용하여 쓰기 전략을 지정할 수 있습니다.

writemodel.strategy=<a writemodel strategy>

카테고리별로 정리된 싱크 connector 구성 설정 목록은 싱크 Connector 구성 속성가이드 를 참조하세요.

이름
설명
DefaultWriteModelStrategy

Description:
This strategy uses the ReplaceOneDefaultStrategy by default, and the InsertOneDefaultStrategy if you set the timeseries.timefield option.

This is the default value for the writemodel.strategy configuration setting.
InsertOneDefaultStrategy

Description:
Insert each sink record into MongoDB as a document.
Apply the following configuration to your sink connector to specify this setting:
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.InsertOneDefaultStrategy
ReplaceOneDefaultStrategy

Description:
Replaces at most one document in MongoDB that matches a sink record by the _id field. If no documents match, insert the sink record as a new document.
Apply the following configuration to your sink connector to specify this setting:
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneDefaultStrategy
ReplaceOneBusinessKeyStrategy

Description:
Replaces at most one document that matches a sink record by a specified business key. If no documents match, insert the sink record as a new document.
Apply the following configuration to your sink connector to specify this setting:
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy
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 implicitly specified when you set mongodb.delete.on.null.values=true.
You can set this explicitly with the following configuration:
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneDefaultStrategy
DeleteOneBusinessKeyStrategy

Description:
Deletes at most one MongoDB document that matches a sink record by a business key.
Apply the following configuration to your sink connector to specify this setting:
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneBusinessKeyStrategy
To see an example showing how to use this strategy, see our guide on write model strategies.
UpdateOneTimestampsStrategy

Description:
Add _insertedTS (inserted timestamp) and _modifiedTS (modified timestamp) fields into documents.
Apply the following configuration to your sink connector to specify this setting:
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy
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.
Apply the following configuration to your sink connector to specify this setting:
writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy

돌아가기

ID 전략

이 페이지의 내용