You must hand in by using git
bitbucket.org,
gitlab.com, or
github.com,
git push your local repo to the above remote repo.
node_modules/
.gitignore file.
Send a mail to <nmla@iba.dk> with:
handin <subjectname>'
in the subject line of your mail
In today's lesson you will find in Example 46.3
examples of extended schema attributes. You may copy the
code from mongooseUser5.js to do the following.
String constraint, and
explain what happens. We are interested in the
mongoose error message, and your interpretation of
it.
Number constraint, and
explain what happens. We are interested in the
mongoose error message, and your interpretation of
it.
Date constraint, and
explain what happens. We are interested in the
mongoose error message, and your interpretation of
it.
unique, and explain what
it does. Make an experiment that proves yours and
mongooses point.
required constraint, and
explain what happens. We are interested in the
mongoose error message, and your interpretation of
it.
With the results of the previous assignment in mind
change the Country object from last weeks
project so that it uses extended constraints. Then test
and iterate until error free. It is especially important
that you consider the application of the unique
constraint. Discuss your choice.
Once it works for country, repeat the process for all collections that may be inserted in your project.
Sanitation means cleaning the user entered data for all things
detrimental to our application. It could be as simple as
making sure enough text was entered, but it could also mean
checking that no script tags were entered in input
fields or textareas.
Take some time to study https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/forms.
Take one of the forms from the project. Country gives you more
experience, and decide on a sanitation scheme, then implement
it. Try various aspects of express-validators
functionality.