Mongoose schemas can be used to add structure and validation through a process called data modeling. Scott walks through the code to create a schema, and demonstrates the different ways properties can be defined.
- So data modeling. So now that we have our…scaffold built out, we built the routes,…we have the router working,…we have our config set up,…we have some utilities with middleware,…the server's running, everything's good.…We just now need to plug in some actual data,…and the controller to that data.…Remember on the last step we set all of that stuff up.…So now we just need to replace the…the stuff that we have in here.…So if we go look in here,…we're doing nothing but sending back an okay.…We need to add in some models and some controllers in here.…
So the first thing we need to do is before we do that…is we need to figure our how our data's going to look like.…But before we do that, we need to figure out…how to even model that data.…So, we can use schemas in Mongoose to add…structure and validations to our data.…So Mongo does not need schemas though,…remember again, Mongo, the database itself,…doesn't need schemas, we just throw whatever you want at it.…Mongoose gives us the ability to define those schemas…and those blueprints to rationalize about our data…
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.