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

Mongo SMT dose not support `add.fields=patch`

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 1.3.0.Beta2
    • 1.2.2.Final
    • mongodb-connector
    • None

       

      Hi, background is I'm using mongo connector SMT, assuming we have a doc with three columns:{_id: 1, a: 1, b:1, c:1}

      If I update the whole doc:update({"_id" : 1}, {"a": 2 }) -> final row: {_id:1, a:2}
      The smt will give me payload as => {id:1, a:2}

      If I just set one column:update({"_id" : 1}, {$set: {a:2}}) -> final row:{_id:1, a:2, b:1, c:1}
      The smt will give payload as => {id:1, a:2}

      So when I get a payload as {id:1, a:2}, how should I determine whether I should replace all the doc as {a:2} or I just set a-> 2 remaining all the other fields the same.

      I tried to add the patch to add.fields to distinguish the unset/set operations but got 

      java.lang.IllegalArgumentException: Unexpected field name: 

       

        1. 111.png
          329 kB
          yoga yang

              ccranfor@redhat.com Chris Cranford
              yoggaaaaa yoga yang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: