From the course: Databases for Node.js Developers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Set up MongoDB
- [Instructor] To get started with MongoDB, we first have to use Docker to download and run a container for it. Make sure that your Docker daemon is running. Here on my system, I can just click on this Docker icon in my taskbar and see that the desktop daemon's running. And then I will start in my terminal that I opened already by running docker pull mongo. This'll pull down the latest MongoDB image from Docker hub. Next, we have to start this container, and for that, I will now run docker run --name, that's the name of this container, and I will call it mongodb. And now I'm adding -p and then I add some port configuration. So I will explain this in a second. I now add 37017:27017. This tells Docker that it should map the internal default port of Mongo DB of 27017 to 37017. I'm doing that this way just to make sure that if you have Mongo DB already running on this system, that this does not collide. And then in the…
Contents
-
-
-
-
-
(Locked)
When to use and not to use document databases2m 11s
-
(Locked)
Set up MongoDB4m 39s
-
(Locked)
Connect to MongoDB13m 54s
-
(Locked)
Insert data into MongoDB6m 43s
-
(Locked)
Query data from MongoDB4m 41s
-
(Locked)
Introduction to Mongoose9m 24s
-
(Locked)
Add MongoDB and Mongoose to your project5m 57s
-
(Locked)
Define your first schema and model3m 50s
-
(Locked)
Prepare the item management system6m 4s
-
(Locked)
Implement all database methods7m 48s
-
(Locked)
Implement the user management system7m 26s
-
(Locked)
Encrypting passwords4m 40s
-
(Locked)
-
-
-