Hi All,
I'm in the process of setting up Debezium Server. So far it works very well, however I'm struggling to capture the MongoDB document ID on delete events.
Typically, I grab the document ID in the 'after' property of the JSON payload. But on delete events the 'after' property is null/none as expected.
Now looking at the documentation, if I enable 'schema' the document should be encapsulated inside a 'payload' property which should contain an ID. Unfortunately, that doesn't seem to work. The payload still outputs as follows:
{'after': None,
'patch': None,
'filter': None,
'updateDescription': None,
'source':
{'version': '1.8.1.Final',
'connector': 'mongodb',
'name': 'testdb',
'ts_ms': 1654764135000,
'snapshot': 'false',
'db': 'testdb',
'sequence': None,
'rs': 'testdb-shard-0',
'collection': 'contracts',
'ord': 1,
'h': None,
'tord': None,
'stxnid': None,
'lsid': None,
'txnNumber': None
},
'op': 'd',
'ts_ms': 1654764135671,
'transaction': None
}
Any ideas on how I can emit the document ID on delete events?