Can we update/Upsert a record in mongodb? data source is kafka

前端 未结 2 460
迷失自我
迷失自我 2021-01-05 08:59

We can update/upsert the record in mongodb BUT is there is any method or function from which we can update or upsert the document directly in mongodb and the source system i

2条回答
  •  失恋的感觉
    2021-01-05 09:14

    Yes we can update/upsert the data. For update you have to define a parameter in Kafka connector. and whitelist the column on which bases you want to update the record. The property is as followed:

    document.id.strategy=com.mongodb.kafka.connect.sink.processor.id.strategy.PartialValueStrategy
    value.projection.list=tokenNumber
    value.projection.type=whitelist
    writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy
    

提交回复
热议问题