Scott walks through the solution to exercise 7. He also briefly discusses collection naming conventions in Mongoose.
(dramatic Asian music)…- Cool, so when that looks like it's…connected to the database,…I'm just connecting to todos.…I'm just going to change it, 'cause that's the name,…that's the name of the collection as well,…so I'll change this to something else, like,…puppies.…Alright, so we run this file,…I'm not sure I cleaned this stuff up.…Alright, it'll say, boom,…you're like, alright, this is what I created.…
And then what we can do is,…go over to our shell,…I'm just going to say, use the name,…and now, what happens is, if you didn't,…if you didn't hear me when I tell you…what collection it was,…the way you would figure that out…is if you were in this file,…and we have this mongoose.model?…Takes two arguments, well,…actually, it's a getter and a setter,…so if you pass in a second argument,…it's assuming that you want to create a model.…If you exclude the second argument,…it's assuming you are trying to reference a model.…
So it's a getter and a setter.…So we're doing the setter, we're creating a model,…and the way that works is, the first argument…
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
Node.js: Extend and Maintain Applicationswith Daniel Khan3h 35m 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.