Docs Menu

Docs HomeDevelop ApplicationsMongoDB DriversNode.js Driver

MongoDB Node Driver

Welcome to the documentation site for the official MongoDB Node.js driver. You can add the driver to your application to work with MongoDB in JavaScript or TypeScript. For more information about downloading and installing the Node.js driver, see Download and Install in the Quick Start guide.

You can connect using the Node.js driver for deployments hosted in the following environments:

  • MongoDB Atlas: The fully managed service for MongoDB deployments in the cloud

  • MongoDB Enterprise: The subscription-based, self-managed version of MongoDB

  • MongoDB Community: The source-available, free-to-use, and self-managed version of MongoDB

Learn how to establish a connection to MongoDB Atlas and begin working with data in the step-by-step Quick Start.

See driver syntax examples for common MongoDB commands in the Quick Reference section.

For a list of new features and changes in each version, see the What's New section.

For fully runnable code snippets and explanations for common methods, see the Usage Examples section.

Learn how to perform the following tasks using the Node.js driver in the Fundamentals section:

For step-by-step explanations of common aggregation tasks, see the Aggregation Tutorials section.

For detailed information about classes and methods in the MongoDB Node.js driver, see the MongoDB Node.js driver API documentation.

For answers to commonly asked questions about the MongoDB Node.js Driver, see the Frequently Asked Questions (FAQ) section.

For solutions to issues you might encounter when using the driver to connect to a MongoDB deployment, see the Connection Troubleshooting section.

Learn how to report bugs, contribute to the driver, and to find help in the Issues & Help section.

For the compatibility tables that show the recommended Node.js driver version for each MongoDB Server version, see the Compatibility section.

Learn what changes you must make to your application to upgrade driver versions in the Upgrade Driver Versions section.

MongoDB and our partners provide several object-document mappers (ODMs) for Node.js that let developers work with MongoDB data as objects. One popular ODM is Mongoose, which helps enforce a semi-rigid schema at the application level and provides features to assist with data modeling and manipulation. Prisma, another ODM, helps ensure data consistency by offering a type-safe database client and an intuitive schema.

For more information about using ODMs with MongoDB, see the following resources:

You can install the following packages to expand the functionality of the Node.js driver:

Package
Description
BSON serialization and deserialization library used by the official MongoDB Node.js driver
C++ extension for Node.js that provides support for Kerberos authentication
Library for client-side encryption functionality
Legacy Node.js driver with optional callback support
Zstandard compression library for Node.js

For information about each package's version compatibility, see the Component Support Matrix in the Node.js driver Github repository.

Visit the Developer Hub and MongoDB University to learn more about the Node.js driver.

The Developer Hub provides tutorials and social engagement for developers.

To learn how to use MongoDB features with the Node.js driver, see the How To's and Articles page.

To ask questions and engage in discussions with fellow developers using the Node.js driver, see the Developer Community forums.

MongoDB University provides free courses to teach everyone how to use MongoDB.

MongoDB University Node.js Course graphic

Using MongoDB with Node.js

Learn the essentials of Node.js application development with MongoDB.

MongoDB University Node.js Learning Path graphic

MongoDB Node.js Developer Path

Gain a comprehensive understanding of Node.js application development, complex operations, interactions with MongoDB Atlas datasets, and more.

Quick Start →