Reputation: 13
I am doing a course, but it is quite old and there is no one to answer the question. I hope the information provided is enough. Why don't i get an required field error, when use save() method without required schema fields given. I only describe two required fields: password and passwordConfirm, but no name and email, should't we get an required field error since we use save() method, which should run our schema validators. I run this controller to update password: enter image description here User schema: enter image description here Sending this body information via postman: enter image description here
Upvotes: 0
Views: 34
Reputation: 13
runValidators command will only act on updated properties not others, thats why i got errors only from password validator, but no other required fields, because i didn't update other fields.
Upvotes: 0