MongoDB Node.js Driver

The next generation Node.js driver for MongoDB

Latest documentation

Introduction

The official MongoDB Node.js driver allows Node.js applications to connect to MongoDB and work with data. The driver features an asynchronous API which allows you to interact with MongoDB using Promises or via traditional callbacks.

Features

MongoDB Driver
Whether you are new to MongoDB or you just want to brush up on the core concepts, you can check out the Fundamentals section which features material on using the Node.js driver for the following:
  • Connection Guide: connect to a MongoDB instance or replica set
  • Authentication: configure authentication and log a user in
  • CRUD Operations: read and write data to MongoDB
  • Promises and Callbacks: access return values using asynchronous Javascript
  • Indexes: create and design indexes to make your queries efficient
  • Collations: apply language-specific sorting rules to your query results
  • Logging: configure the driver to log MongoDB operations
  • Monitoring: configure the driver to monitor MongoDB server events

Quick Start

Given that you have created your own project using `npm init` we install the mongodb driver and its dependencies by executing the following `npm` command.

npm install mongodb --save

This will download the MongoDB driver and add a dependency entry in your `package.json` file.


MongoDB University


Using MongoDB with Node.js

This course guides you through everything you need to get started with MongoDB in your NodeJS applications. In this course, you’ll get an overview of the official MongoDB NodeJS/Javascript driver and learn how to install it by using npm. You’ll learn how to connect your application, perform basic CRUD operations, troubleshoot, and then build aggregations.

Learn More


MongoDB Node.js Developer Path

This learning path contains a series of courses to teach you MongoDB skills. In this path, you’ll learn the basics of building modern applications with Node.JS, using MongoDB as your database.

Learn More

Releases

ReleaseDocumentation
Next Driver Reference | API
6.12 Driver Reference | API
6.11 Driver Reference | API
6.10 Driver Reference | API
6.9 Driver Reference | API
6.8 Driver Reference | API
6.7 Driver Reference | API
6.6 Driver Reference | API
6.5 Driver Reference | API
6.4 Driver Reference | API
6.3 Driver Reference | API
6.2 Driver Reference | API
6.1 Driver Reference | API
6.0 Driver Reference | API
5.9 Driver Reference | API
5.8 Driver Reference | API
5.7 Driver Reference | API
5.6 Driver Reference | API
5.5 Driver Reference | API
5.4 Driver Reference | API
5.3 Driver Reference | API
5.2 Driver Reference | API
5.1 Driver Reference | API
5.0 Driver Reference | API
Legacy Versions

⚠️ The following versions are no longer maintained. For the latest bug fixes and features, please upgrade to a version listed above.

ReleaseDocumentation
4.17 Driver Reference | API
4.16 Driver Reference | API
4.15 Driver Reference | API
4.14 Driver Reference | API
4.13 Driver Reference | API
4.12 Driver Reference | API
4.11 Driver Reference | API
4.10 Driver Reference | API
4.9 Driver Reference | API
4.8 Driver Reference | API
4.7 Driver Reference | API
4.6 Driver Reference | API
4.5 Driver Reference | API
4.4 Driver Reference | API
4.3 Driver Reference | API
4.2 Driver Reference | API
4.1 Driver Reference | API
4.0 Driver Reference | API
3.7 Driver Reference | API
3.6 Driver Reference | API
3.5 Driver Reference | API
3.4 Driver Reference | API
3.3 Driver Reference | API
3.2 Driver Reference | API
3.1 Driver Reference | API
3.0 Driver Reference | API
2.2 Driver Reference | API