hiddentao / robe

MongoDB ODM for Node.js using ES6 generators. Supports schema validation, raw querying, oplog tailing, etc.
http://hiddentao.github.io/robe
MIT License
177 stars 12 forks source link

oplog.o2 field is being omitted #15

Closed sergioregueira closed 8 years ago

sergioregueira commented 8 years ago

Hello,

I have modified your library to send the oplog.o2 field on document updates, because we do not have enough information to identify the updated document without it when the update is applied using operators like $set.

For example, if you apply the following update:

db.getCollection('tag').update({"_id": ObjectId("57237dd64945890e00f1c39c")}, {"$set":{"updatedAt":"2016-04-29T15:42:36.192Z"}})

You have access only to this data:

{"$set":{"updatedAt":"2016-04-29T15:42:36.192Z"}}

Nevertheless, if you access to the oplog.o2 field, you have this extra important:

{"_id":"57237dd64945890e00f1c39c"}

As you can see, this information is very important and should be accessible.

Thank you very much.

hiddentao commented 8 years ago

Awesome. Thanks!

sakshamsaxena commented 8 years ago

Thanks a lot! Also, please update the docs for this maybe as well? Thanks a lot again!

hiddentao commented 8 years ago

Docs updated, thanks.