The video for this lesson is currently being updated, please read the transcript instead.

Adding model validation

Mongoose allows you to add additional properties to a model that define how it can be saved or updated.

Let's go ahead and create a second model that we'll be using in the API: a user.

We'll pop that directly underneath the Item model definition. Let's create a variable User and again call the model method of the mongoose object.

To view the complete lesson you'll need to login or join this course.


Click to load comments...