Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-7695

Mongodb Delete events should have `_id` in the payload

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.7.0.Alpha1
    • None
    • mongodb-connector
    • None
    • False
    • None
    • False

      Currently Mongodb connector is not providing enough information in the payload for delete events.

      for the delete events, it will be good improvement, if the key fields/values are added to payload as well

      What is the connector configuration?

      debezium.transforms=unwrap,renamekeyfield
      debezium.transforms.unwrap.type=io.debezium.connector.mongodb.transforms.ExtractNewDocumentState
      debezium.transforms.unwrap.delete.handling.mode=rewrite

      full config visible here https://github.com/memiiso/debezium-server-iceberg/issues/291#issuecomment-1993483748

      What is the captured database version and mode of depoyment?

      mongodb

      What behaviour do you expect?

      for delete events payload should include `{}id` and `{}op` and `{_}_deleted` fields.
      "payload":

      "payload": { 
      "_id": 1004, 
      "__op": "d"
      "__deleted": true
      }

      What behaviour do you see?

      unwrapped event is:

      "payload": {
      "__deleted": true
      }
      

      Do you see the same behaviour using the latest relesead Debezium version?

      YES

      Do you have the connector logs, ideally from start till finish?

      posted here https://github.com/memiiso/debezium-server-iceberg/issues/291

      Feature request or enhancement

      mongodb delete events should unwrap and add more information to payload.

      especially `_id` and delete fields.

      "payload": { "_id": 1004, "__op": "d" "__deleted": true } 

      Which use case/requirement will be addressed by the proposed feature?

      This will align mongodb implementation to much closer to the standard and will align RDBMS standard

      Implementation ideas (optional)

      take the information from the key and add it to payload.

              Unassigned Unassigned
              ismailsimsek ismail simsek
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: