Open-source project
mongodb/node-mongodb-native avatar
mongodb/node-mongodb-native

The MongoDB Node.js driver pins bson, kerberos and client encryption to the same major version, and v7 drops mongodb-legacy

The official MongoDB Node.js driver

10,176 stars1,826 forksTypeScriptApache-2.0

At a glance

What is it?
mongodb/node-mongodb-native is the official TypeScript driver published to npm as mongodb. Version 7 pins bson, kerberos and client encryption to ^7.0.0, supports servers from 4.4, and signs its release tarballs with GPG.
Who is it for?
Use this driver when you want the vendor-maintained client for MongoDB 4.4 or newer from Node.js, and you are prepared to match the major versions of bson, kerberos and mongodb-client-encryption to the driver. Anyone upgrading from 6.x or earlier should read etc/notes/CHANGES_7.0.0.md first, and anyone relying on mongodb-legacy has no version for 7.x in the support matrix.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • mongodb/node-mongodb-native10,176 ★ · +2
Star history
Repository2026-10-082026-11-25
mongodb/node-mongodb-native10.2k10.2k

2 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Add-on packages must match the driver major, and the matrix says so per version

The driver keeps optional features in separate npm packages, and the Readme carries a Component Support Matrix because mixing versions is unsafe. Only packages with versions in the listed ranges are stable in combination.

For [email protected] the matrix gives bson ^7.0.0, kerberos ^7.0.0 and mongodb-client-encryption ^7.0.0. For mongodb@>=6.12 and mongodb@<6.12 the bson range is ^6.0.0, kerberos ^2.0.1 and mongodb-client-encryption ^6.0.0. The 5.x row reads bson ^5.0.0, kerberos ^1.0.0 or ^2.0.0 and mongodb-client-encryption ^2.3.0. Going back to 3.x, bson is ^1.0.0.

The table has two N/A patterns worth reading. bson-ext is N/A from 5.x onward. mongodb-legacy is N/A for 7.x, after ^4.0.0, ^5.0.0 and ^6.0.0 for the earlier rows. A project that wraps callbacks through mongodb-legacy therefore has no supported combination on the current line.

Only three packages are hard dependencies and seven others are optional peers

In package.json, the runtime dependencies are @mongodb-js/saslprep ^1.5.0, bson ^7.3.2 and mongodb-connection-string-url ^7.0.2. Everything else is a peer dependency flagged optional in peerDependenciesMeta: @aws-sdk/credential-providers, @mongodb-js/zstd, gcp-metadata, kerberos, mongodb-client-encryption, snappy and socks.

Optional peers change what a plain install gives you. Compression with zstd or snappy, Kerberos authentication, client-side encryption, AWS credential providers, GCP metadata lookups and SOCKS proxying all need you to add the matching package yourself. Without it the feature is absent, not degraded.

The published package contains lib, src, etc/prepare.js, mongodb.d.ts and tsconfig.json. The entry point is lib/index.js and the types are in mongodb.d.ts, which fits a TypeScript codebase that is compiled before publishing. The package name on npm is mongodb, the license is Apache-2.0, and the contact listed is The MongoDB NodeJS Team.

Release tarballs are GPG-signed, but npm install never checks the signature

Releases are created automatically and signed with the Node team's GPG key. Every release package attached to a GitHub release is signed, and the release holds a detached signature file named mongodb-X.Y.Z.tgz.sig. The check starts with importing the key:

shell
gpg --import node-driver.asc

Then you need the tarball. This command returns the npm tarball link for a version:

shell
npm view [email protected] dist.tarball

After downloading with curl, the verification itself is:

shell
gpg --verify mongodb-X.Y.Z.tgz.sig mongodb-X.Y.Z.tgz

The Readme adds a limit that matters: no GPG verification is done when using npm to install the package. The contents of the GitHub tarball and npm's tarball are identical, so the signature is something you check by hand, outside your normal install.

npm audit signatures covers provenance for registry releases

Releases published to the npm registry also carry a provenance attestation. It cryptographically links the package to its source repository and build workflow, and the check is one command:

shell
npm audit signatures

This is the verification route that fits an ordinary install. It runs against what npm already fetched, with no key import and no manual tarball download. The GPG route and the provenance route answer different questions: the first confirms the file was signed by the Node team, the second ties the registry package to a build.

The repository holds release-please-config.json and .release-please-manifest.json at the top level, and the Readme says the driver follows semantic versioning. A sbom.json also sits among the top-level files, next to THIRD-PARTY-NOTICES, for teams that need to list what ships inside the package.

Server support starts at 4.4 and the compatibility matrices live outside the repository

The driver currently supports 4.4+ servers. For exhaustive server and runtime tables it sends you to the compatibility page of the MongoDB Node.js driver documentation, which has separate anchors for MongoDB compatibility and for language compatibility.

The Node.js versions each driver release runs on are in the language compatibility table the Readme links. package.json lists @types/node ^22.20.1 as a dev dependency, which is the typings the project builds against and does not by itself state a runtime requirement. Before upgrading a production service, open the language compatibility table in the docs and compare it with your Node release.

The Readme opens with a banner for people upgrading to version 7 and links the guide at etc/notes/CHANGES_7.0.0.md. It is the one file to read before moving from 6.x, because the matrix shows bson, kerberos and mongodb-client-encryption all jumping to ^7.0.0 in the same release.

Bugs go to a public JIRA project, not to GitHub issues

The contribution path is unusual for a GitHub repository. Bugs and feature requests go to the NODE project at jira.mongodb.org. You create an account, log in, navigate to jira.mongodb.org/browse/NODE and click Create Issue, giving as much information as possible about the issue type and how to reproduce it.

Reports in JIRA for all driver projects (NODE, PYTHON, CSHARP, JAVA) and the Core Server project (SERVER) are public. Anything you paste into a ticket is visible, so strip connection strings and credentials from your reproduction first.

Questions follow a separate route. The Readme asks that you do not email driver developers directly and points to the MongoDB support channels and to the MongoDB Community Forums, under the Node.js driver tag. Stack Overflow is linked with a search for typescript, javascript or node.js together with mongodb. The change history is in HISTORY.md, and CONTRIBUTING.md covers pull requests. The top level also holds AGENTS.md and CLAUDE.md files, which are instructions for AI coding agents working on the repository.

Monthly releases through v7.7.0 on 2026-09-28 and a push on 2026-10-23

The three newest releases are v6.22.0 on 2026-11-03, v7.8.0 on 2026-10-30 and v7.7.0 on 2026-09-28. The repository is not archived, and the last push was 2026-11-02.

The default branch is main and the implementation language is TypeScript. Tests run with mocha (.mocharc.js) and nyc (.nycrc.json), the lint config is .eslintrc.json with Prettier formatting, and .evergreen/ plus drivers-evergreen-tools hold the continuous integration pieces for MongoDB's own build system. API documentation is generated by typedoc and api-extractor, which is how the published reference at mongodb.github.io/node-mongodb-native is produced.

With minor releases arriving every few weeks, a caret range on mongodb in your own package.json will move often. Pin the add-ons from the matrix alongside it, and read HISTORY.md for each minor before deploying, since the Readme does not summarise what any individual release changed.

Editorial conclusion

Use this driver when you want the vendor-maintained client for MongoDB 4.4 or newer from Node.js, and you are prepared to match the major versions of bson, kerberos and mongodb-client-encryption to the driver. Anyone upgrading from 6.x or earlier should read etc/notes/CHANGES_7.0.0.md first, and anyone relying on mongodb-legacy has no version for 7.x in the support matrix.

Frequently asked questions

Which MongoDB server versions does the node-mongodb-native driver support?

The driver currently supports 4.4+ servers. The Readme links to the full MongoDB and Node.js compatibility tables in the official documentation.

How do I verify a node-mongodb-native release?

Import node-driver.asc with gpg and check the detached .sig file against the tarball, or run npm audit signatures for the provenance attestation. npm install itself does no GPG verification.

Where do I report a node-mongodb-native bug?

Open an issue in the NODE project on jira.mongodb.org. Bug reports in JIRA for the driver projects are public.

Does node-mongodb-native 7.x work with mongodb-legacy?

The support matrix lists mongodb-legacy as N/A for [email protected]. It lists ^6.0.0 for the 6.x rows and ^4.0.0 and ^5.0.0 for 4.x and 5.x.

Official sources

  1. License: Apache-2.0
  2. mongodb/node-mongodb-native on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mongodb-node-mongodb-native.svg)](https://hysenlabs.com/projects/mongodb-node-mongodb-native)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/mongodb-node-mongodb-native.svg)](https://hysenlabs.com/projects/mongodb-node-mongodb-native)

Was this useful?