scottwrobinson / camo

A class-based ES6 ODM for Mongo-like databases.
556 stars 80 forks source link

Validation does not work on findOneAndUpdate #60

Closed kurdin closed 8 years ago

kurdin commented 8 years ago

I have model schema with 10 props and one of them is active: { type: Boolean, default: true}, when I do Model.findOneAndUpdate(query, {active: "none"}).then(result => result); I get object in result with active: "none" . Even if I added any field to update data like {active: "none", not_existed_prop: true} I can see in database updated object has not_existed_prop: true after update. I use nedb driver.

scottwrobinson commented 8 years ago

Thanks for posting this. Although, it's actually a duplicate of #25 (which still refers to the old loadOneAndUpdate()). Hoping to get to it within the week.