jedireza / mongo-models

:package: Map JavaScript classes to MongoDB collections
MIT License
67 stars 28 forks source link

Support for other WriteResult parameters #12

Closed henriquesa closed 7 years ago

henriquesa commented 7 years ago

Write operations like update, updateOne, replaceOne, etc. often have more results than modifiedCount. In my case, I'd like to access matchedCount to see if my filter actually got any hits. What do you think about returning to these callbacks not only modifiedCount, but as a third parameter the raw operation result so we can access these? The callback would use the signature function (error, count, results) in these cases.

I'm able to open a PR with updated testing and documentation if you think that's a good idea.

jedireza commented 7 years ago

Sounds like a good idea. A PR is welcome.