In this video, learn how to add Mongoose to your project and how to set it up.
- [Instructor] We will now add and set up Mongoose…within our sample shopping application.…For that, please open the project called Shopsy.…I've done that already.…We've prepared it already before when we set up…the sample apps.…Just as a reminder, whenever you use project…from the exercise files,…make sure that you run npm install on the console…at the very beginning.…I've done that already.…You see that, because I have this node modules folder…here already.…Next, we want to add Mongoose to the project.…
For that, I run npm install --save mongoose.…This will pull down Mongoose from npm and additional,…it will also install MongoDB,…the driver we saw in the previous example, as dependency.…Now, I will open the config file.…That's in Server, config, index.js.…
Here I want to add information…about our database connection.…I add MongoDB:…{ object,…and I will define the dsn here.…Dsn is mongodb://…localhost enter 37017/shopsy…for the database.…
Maybe you're wondering why we see this red underline here.…This is due to the link…
Author
Released
12/12/2017- Basics of relational and nonrelational databases
- Preparing your environment
- When to use document databases
- Inserting data into MongoDB
- Basic insert operations for MongoDB
- Querying data from MongoDB with Node.js
- Using key-value stores
- Using relational databases with Node.js
- Adding MySQL and Sequelize to a project
Skill Level Intermediate
Duration
Views
Related Courses
-
Node.js: Testing and Code Quality
with Jon Peck3h 25m Intermediate
-
Introduction
-
Welcome38s
-
Using the exercise files1m 6s
-
-
1. Get Started with Databases for Node.js
-
2. Prepare Your Environment
-
Install Node.js1m 26s
-
Install Docker1m 44s
-
Set up the sample apps9m 3s
-
-
3. Use Document Databases with Node.js
-
Set up MongoDB4m 35s
-
Connect to MongoDB3m 26s
-
Insert data into MongoDB7m 29s
-
Query data from MongoDB4m 15s
-
Introduction to Mongoose2m 59s
-
Define your first model6m 55s
-
Implement all database functions10m 17s
-
4. Use Key-Value Stores with Node.js
-
Set up Redis2m 41s
-
Use Node.js with Redis7m 55s
-
Implement a basket service10m 20s
-
Put everything together9m 28s
-
Wire up a basket page4m 16s
-
5. Use Relational Databases with Node.js
-
Set up MySQL3m 45s
-
Create a database schema4m 7s
-
Use Node.js with MySQL10m 55s
-
Introduction to Sequelize2m 24s
-
Review the database design1m 23s
-
Implement an order service8m 30s
-
Conclusion
-
Next steps37s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Add MongoDB and Mongoose to your project