fullstack-hy2020 / fullstack-hy2020.github.io

Home Page:https://fullstack-hy2020.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

part 3d does not reference official mongoosejs documentation

bambery opened this issue · comments

part 3d "validation"

"We notice that the backend has now a problem: validations are not done when editing a note. The documentation addresses the issue by explaining that validations are not run by default when findOneAndUpdate is executed."

problem - "The documentation" is for a plugin from some random guy (does he develop for mongoose? mongoose-unique-validator seems to be a standalone plugin). Why is this being referenced as "the documentation"? Instead, the course should point to standard documentation,
https://mongoosejs.com/docs/api/model.html#Model.findByIdAndUpdate()
https://mongoosejs.com/docs/validation.html#update-validators

In the second link, it says "Update validators are off by default, you need to specify the 'runValidators' option", which is the information the student should be looking for here.