From the course: MongoDB Node.js Developer Associate Cert Prep

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Connecting to an Atlas cluster in Node.js applications

Connecting to an Atlas cluster in Node.js applications

From the course: MongoDB Node.js Developer Associate Cert Prep

Connecting to an Atlas cluster in Node.js applications

- Hi. In this video you will learn how to install the official MongoDB Node.js driver by using the NPM Package Manager. You'll also learn how to connect a MongoClient instance in a Node.js application to an Atlas cluster by using a connection string. Finally, you'll learn how to instantiate a single MongoClient that can be reused across all database requests. Let's get started by using the NPM package manager to install the MongoDB nodejs driver. To follow along with this demo, create a new Node.js console app by creating a new folder called test. Then initialize it as a Node.js project by using the following command: npm init. You'll likely get an error if you don't already have NPM installed globally. Check out the official NPM documentation to ensure that you have Node.js and the Node package manager installed. If you're using a different IDE, or if you're using a text editor, the experience will be slightly…

Contents