March 2018
Intermediate to advanced
592 pages
13h 44m
English
Now, we're going to create a brand-new Mongoose model. First up, you're going to make a new User model. Eventually, we're going to use this for authentication. It's going to store stuff like an email and a password, and the Todos are going to be associated with that User so when I create one, only I can edit it.
We'll look into all these, but for now, we're going to keep things really simple. On the User model, the only property that you need to set up is the email property. We'll set up others like password later, but it's going to be done a little differently since it needs to be secure. For now, we'll just stick with email. I want you to require it. I also want you to trim it, so if someone ...