DataReply / kafka-connect-mongodb

Apache License 2.0
129 stars 61 forks source link

No _id when updating by query #25

Open nvitucci opened 6 years ago

nvitucci commented 6 years ago

I am using MongoDB as a source. When I update documents by query (e.g. with an update({amount: 100}, {$push: {values: 10}}), with or without the multi option), I cannot find the _ids of the updated documents in the messages produced by the connector. It looks like they are stored in an o2 field in the oplog.rs collection, while the messages only use the content of the o field.

In order to reproduce:

Notice that the document has been updated but there is no mention of its _id in the message, which looks like the following:

{ "schema": ...}, "payload": { "timestamp": 1522613398, "order": 1, "operation": "u", "database": "test.coll", "object": "{ \"$set\" : { \"values.1\" : 10.0 } }" } }

nvitucci commented 6 years ago

Any updates on this?