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:
create an empty collection coll in a test database;
create a document such as {"label": "Label", "amount": 100, "values": [1]};
update it with db.getCollection('coll').update({amount: 100}, {$push: {values: 10}});
Notice that the document has been updated but there is no mention of its _id in the message, which looks like the following:
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 themulti
option), I cannot find the_id
s of the updated documents in the messages produced by the connector. It looks like they are stored in ano2
field in theoplog.rs
collection, while the messages only use the content of theo
field.In order to reproduce:
coll
in atest
database;{"label": "Label", "amount": 100, "values": [1]}
;db.getCollection('coll').update({amount: 100}, {$push: {values: 10}})
;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 } }" } }