From the course: Databases for Node.js Developers

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Connect to MongoDB

Connect to MongoDB

From the course: Databases for Node.js Developers

Start my 1-month free trial

Connect to MongoDB

- [Instructor] We will now extend our maxcoin sample application to connect to the MongoDB server that we just installed. For that, I will change into the maxcoin directory on my integrated terminal here and I will also open the maxcoin directory here on the left menu bar. All databases have some communication channel that can be used programmatically and database drivers provide us with an API to perform operations on the database using this channel. For MongoDB, there is an official npm module called MongoDB and we can install it by simply typing npm install MongoDB. And if we look into package.json, we see that it now installed MongoDB and its diversion in my keys no 3.6.2. To know how to use this driver, there is of course an API documentation. So if I head into my browser, I can look for MongoDB node.js api, and there. I end up on a page and there you see a list of different drivers and links to the Reference and…

Contents