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