Here when there is an error, entity is also not set, so the callback gets called saying that an object with that id doesn't exist. The actual error (in my case) was that an empty object of updates was passed in, which causes a mongo error.
Come to think if it this should probably also not make the call to mongo if the updates object is empty.
https://github.com/serby/save-mongodb/blob/master/lib/mongodb-engine.js#L123-L134
Here when there is an
error
,entity
is also not set, so the callback gets called saying that an object with that id doesn't exist. The actual error (in my case) was that an empty object of updates was passed in, which causes a mongo error.Come to think if it this should probably also not make the call to mongo if the updates object is empty.