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.
Some AVRO event
When I use
I get the the following error:
Could not convert key
ABC-123456-XYZ into a BsonDocument.
There are similar questions where the KEY is used as part of the document (see: Kafka sink connector : How to get Kafka message key into document), but I cannot find information on using the String KEY.
Thanks in advance.