Hello,
I am using MongoDB sink. Where I have sink my data to my MongoDB database. The data sink works fine. But the problem is that my upsert is not performing. It creates a new field _id
and the my data is generated in the table. So could anyone suggest to me on this how to do this. Here is my configuration file.
{
"name": "topic_sink",
"config": {
"connector.class": "com.mongodb.kafka.connect.MongoSinkConnector",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "io.confluent.connect.avro.AvroConverter",
"topics": "service-topic",
"connection.uri": "mongodb://xxx:xxx@0.0.0.0:27017/",
"database": "admin",
"value.converter.schema.registry.url": "http://0.0.0.0:8081",
"insert.mode": "upsert",
"key.converter.schemas.enable": "false"
}
}
And one more thing is that I want to sink timestamp in the table as well as a separate column but that column is not present in the AVRO schema. It’s a default timestamp of the topic record.
Any help, suggestion appreciated.
Thank you.