我们可以在mongodb中更新/更新记录吗?数据源是kafka [英] Can we update/Upsert a record in mongodb? data source is kafka

查看:102
本文介绍了我们可以在mongodb中更新/更新记录吗?数据源是kafka的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在mongodb中更新/更新记录,但是有任何方法或功能可以直接在mongodb中更新或更新文档,源系统是kafka,目标系统是mongodb.

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 is kafka and destination is mongodb.

推荐答案

是的,我们可以更新/更新数据. 要进行更新,您必须在Kafka连接器中定义一个参数. 并将您要更新记录所依据的列列入白名单.该属性如下:

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

这篇关于我们可以在mongodb中更新/更新记录吗?数据源是kafka的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆