serby / save-mongodb

mongodb persistence engine for save
ISC License
13 stars 14 forks source link

update() doesn't pass along the cb(err) with the mongo error #16

Closed bengourley closed 9 years ago

bengourley commented 10 years ago

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.