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 committed May 26, 2016
1 parent bee4e5c commit 8bab759
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 @@ -134,7 +134,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 8bab759

Please sign in to comment.