Skip to content

Commit

Permalink
Adding runValidators
Browse files Browse the repository at this point in the history
As mentioned here: #73

Still needs a test.
  • Loading branch information
marshallswain authored and daffl committed Jun 17, 2016
1 parent c5b844f commit 4137646
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ class Service {
return Promise.reject('Not replacing multiple records. Did you mean `patch`?');
}

const options = {new: true, overwrite: this.overwrite};
const options = {
new: true,
overwrite: this.overwrite
runValidators: true,
setDefaultsOnInsert: true
};

if (this.id === '_id') {
// We can not update default mongo ids
Expand Down

0 comments on commit 4137646

Please sign in to comment.