In this exercise, you must connect to a Mongo database. Once the database connection code is in place, you can verify the connection through the router.
- So we have small exercise.…If we check out to step seven, it's another small one.…Let me open that up.…There we go, okay.…So in step seven, there is a new file in the root.…
This is called dbTester…and with this file, what we're going to do,…hold on let me silence my phone.…This file, is completely outside of the application…we've just been working on all morning, it's a separate file…that's why I made it on the root, it's just a way for us…to play with Mongoose and Mongo and get familiar with it.…All you need to do in here, is just need to connect…to a database so the below will work.…So once you connect to the database,…the stuff that's happening down here will…be able to work and we can verify it.…
So what's happening below, is that we're…creating a new schema,…and making a todos collection with a todo model.…So they're saying the collection in the model.…The model, is like the representation…of the actual resource that we're going to be creating,…or consuming in our API.…The collection is where that model…
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.