skip to Main Content

Mongodb – How do I increment a field with UpdateOneTimestamps writemodel strategy

I want to continuously update a document's field named value {'_id': 'count', 'value':0} by a certain number. My MongoSinkConnector has document.id.strategy=com.mongodb.kafka.connect.sink.processor.id.strategy.ProvidedInValueStrategy writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy I'm using a python script to produce messages to the appropiate topic self._aio_producer.produce( topic='mongo', value=json.dumps( { "_id":"count", "$inc":{"value":len(task['payload'].split(','))}…

VIEW QUESTION
Back To Top
Search