课程: Databases for Node.js Developers (2021)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Add MongoDB and Mongoose to your project
- [Instructor] In this video, we will now add Mongoose to our project and we will also set it up to establish the connection to MongoDB. For that I already have opened Visual Studio code and in the terminal, I'm in the shopper directory. So just make sure that you're in the right directory. So I move out again, cd .. and you have to do a cd shopper to really be in the shopper directory. And I'm now running npm install mongoose. And this will add Mongoose to the project and it will also install all sub-dependencies and one sub-dependency of Mongoose is our MongoDB driver that we used in the previous example because under the hood, Mongoose is relying on this driver as well. The next question is, where should we add the code that establishes the connection to MongoDB? And I would argue that the express server should not start at all if we cannot connect to the database, because what's the point if the database is not…
内容
-
-
-
-
-
(已锁定)
When to use and not to use document databases2 分钟 11 秒
-
(已锁定)
Set up MongoDB4 分钟 39 秒
-
(已锁定)
Connect to MongoDB13 分钟 54 秒
-
(已锁定)
Insert data into MongoDB6 分钟 43 秒
-
(已锁定)
Query data from MongoDB4 分钟 41 秒
-
(已锁定)
Introduction to Mongoose9 分钟 24 秒
-
(已锁定)
Add MongoDB and Mongoose to your project5 分钟 57 秒
-
(已锁定)
Define your first schema and model3 分钟 50 秒
-
(已锁定)
Prepare the item management system6 分钟 4 秒
-
(已锁定)
Implement all database methods7 分钟 48 秒
-
(已锁定)
Implement the user management system7 分钟 26 秒
-
(已锁定)
Encrypting passwords4 分钟 40 秒
-
(已锁定)
-
-
-