Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed Using SQL ORMs with Node.js!

Instruction

Add Validations to a Model

Overview An ORM like Sequelize can automatically validate a model's, or a column's, value. Currently, you can successfully create a record by passing the Movie model instance an empty string for 'title', a negative 'runtime' integer, or even a release date that dates back to the pre-cinema era. For example: const movie = await Movie.create({ title: '', runtime: -81, releaseDate: '1800...