Scott walks through the solution to exercise 8.
- [Instructor] User model, like I said,…all it has is a username.…Let's type this string.…It's unique, it's also required.…Done, all right.…If we wanted username to be an,…or actually, let's just keep username.…And let's say we wanted to also have like a first name.…Let's say we wanted to have, like,…an address for the user, right?…And we want it to be an object.…Somebody brought this up,…how does it know if it's an object or,…how do we know if this is a nested object,…or how do we know if we're just defining the type.…
So if I had an address.…What I want to do now is going to be different…from what's up here.…This is just saying, I only have a property…that's value is a string,…and it's validated by this.…But by coming out here, saying,…hey, I have an address, and it also has a state property,…just by doing that,…or I'll just say string,…I'm now telling Mongoose that,…oh address is actually an object,…and it has a state property whose type is string.…Just by doing that.…But if I did this, type…string, and now it's like, oh,…
This course was created by Frontend Masters. It was originally released on 12/30/2015. We're pleased to host this training in our library.
- Executing Node.js
- Using Express
- What is middleware?
- Testing in Node.js
- Using Mongo with Node.js
- Data modeling
- Querying data with Mongoose
- Identifying sensitive routes
- Configuring the deployment
Skill Level Intermediate
Node.js: Build Your First Microservicewith Daniel Khan2h 9m Intermediate
Building APIs Using Hapi in Node.jswith Kirsten Hunter2h 23m Intermediate
2. REST APIs
5. Organization and Configuration
7. Data Modeling
10. Securing Routes
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.