Installing the MongoDB database driver for Node.js

You'll need to install database drivers for Node.js, so that Node.js can talk directly to the MongoDB server.

How to do it…

To get the database drivers, simply go to the project directory where you've got your Node.js files and run the following command:

npm install mongodb

This command will download the database drivers and install them for Node.js.

Get JavaScript JSON Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.