I’m new to mongo DB and trying to use the Sink connector to populate a collection. My goal is to use the KEY of the event as the _id for the document. The goal will be to UPDATE a document when an event with the same KEY is received and DELETE the document when an event with an empty value (a.k.a. tombstone event) is received.
I am stuck trying to use the Key of the event which is a string as the unique _id of the document.
KEY (string)
“ABC-123456-XYZ”
Value
Some AVRO event
When I use
“document.id.strategy”: “com.mongodb.kafka.connect.sink.processor.id.strategy.FullKeyStrategy”,
I get the the following error:
Could not convert key ABC-123456-XYZ into a BsonDocument.