Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No _id when updating by query #25

Open
nvitucci opened this issue Apr 1, 2018 · 1 comment
Open

No _id when updating by query #25

nvitucci opened this issue Apr 1, 2018 · 1 comment

Comments

@nvitucci
Copy link

nvitucci commented Apr 1, 2018

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:

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

@nvitucci
Copy link
Author

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant