</>PackageGraphPackageGraph

mongodb

npmv7.6.0TypeScript

The official MongoDB driver for Node.js

Safe to adopt

Yes — mongodb scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 16 days ago. 50 releases in the last 2 years.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • AMaintenance: grade A, Excellent.

    Last published 16 days ago. 50 releases in the last 2 years.

  • BWeight: grade B, Good.

    Pulls in 12 transitive packages, about 7.0 MB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 2 maintainers, and a contained dependency surface.

  • ALicense: grade A, Excellent.

    Apache-2.0 — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding mongodb to a project.

3
Direct dependencies

Runtime packages this one declares itself.

12
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

7.0 MB
Install size

Unpacked size of this package plus its entire runtime tree.

4
Tree depth

Longest resolved dependency chain below this package.

Licenses in the dependency tree

Apache-2.0BSD-2-ClauseMIT

Every license you inherit by installing mongodb, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
node >=20.19.0
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the mongodb README.

const { MongoClient } = require('mongodb');
// or as an es module:
// import { MongoClient } from 'mongodb'

// Connection URL
const url = 'mongodb://localhost:27017';
const client = new MongoClient(url);

// Database Name
const dbName = 'myProject';

async function main() {
  // Use connect method to connect to the server
  await client.connect();
Example truncated — see the full README.

mongodb vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
mongodbthis page03Apache-2.016 days ago
mongoose6.1M0MIT1 day ago
mpath5.8M1MIT1 day ago
mquery4.4M1MIT1 day ago
postgres01Unlicense1 day ago
bson03Apache-2.01 day ago

Dependencies

Declared by mongodb v7.6.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (49)

@aws-sdk/credential-providers ^3.876.0@iarna/toml ^2.2.5@istanbuljs/nyc-config-typescript ^1.0.2@microsoft/api-extractor ^7.58.7@microsoft/tsdoc-config ^0.18.1@mongodb-js/zstd ^7.0.0@types/chai-subset ^1.3.5@types/express ^5.0.6@types/kerberos ^1.1.5@types/mocha ^10.0.9@types/node ^22.15.3@types/saslprep ^1.0.3@types/semver ^7.7.0@types/sinon ^17.0.4@types/whatwg-url ^13.0.0@typescript-eslint/eslint-plugin ^8.60.1@typescript-eslint/parser ^8.31.1aws4 ^1.13.2chai ^5.3.3chai-subset ^1.6.0chalk ^4.1.2esbuild ^0.28.0eslint ^9.39.1eslint-config-prettier ^10.1.8eslint-plugin-mocha ^10.4.1eslint-plugin-prettier ^5.5.6eslint-plugin-simple-import-sort ^12.1.1eslint-plugin-tsdoc ^0.5.2eslint-plugin-unused-imports ^4.4.1express ^5.2.1gcp-metadata ^7.0.1js-yaml ^4.2.0mocha ^11.7.6mocha-sinon ^2.1.2mongodb-client-encryption ^7.2.0nyc ^17.1.0prettier ^3.6.2semver ^7.7.2sinon ^18.0.1sinon-chai ^4.0.1snappy 7.3.3socks ^2.8.7source-map-support ^0.5.21ts-node ^10.9.2tsd ^0.33.0typescript 5.8.3typescript-cached-transpile ^0.0.6v8-heapsnapshot ^1.3.1yargs ^18.0.0

Used by

Popular packages that depend on mongodb.

Relationship graph

Dependencies (left) and dependents (right) of mongodb.

Frequently installed together

Release history

50 releases in the last two years, typically about 1 day apart.

Recent versions of mongodb
VersionPublishedSizeLicense
7.6.0-dev.20260908.sha.83668e622 days ago3.4 MBApache-2.0
7.6.0-dev.20260907.sha.28e455de3 days ago3.4 MBApache-2.0
7.6.0-dev.20260906.sha.28e455de4 days ago3.4 MBApache-2.0
7.6.0-dev.20260905.sha.28e455de5 days ago3.4 MBApache-2.0
7.6.0-dev.20260904.sha.dba1544a6 days ago3.4 MBApache-2.0
7.6.0-dev.20260903.sha.995edbf67 days ago3.4 MBApache-2.0
7.6.0-dev.20260902.sha.995edbf68 days ago3.4 MBApache-2.0
7.6.0-dev.20260901.sha.995edbf69 days ago3.4 MBApache-2.0
7.6.0-dev.20260831.sha.995edbf610 days ago3.4 MBApache-2.0
7.6.0-dev.20260830.sha.995edbf611 days ago3.4 MBApache-2.0
7.6.0-dev.20260829.sha.995edbf612 days ago3.4 MBApache-2.0
7.6.0-dev.20260828.sha.d0c57c0313 days ago3.4 MBApache-2.0
7.6.0-dev.20260827.sha.d0c57c0314 days ago3.4 MBApache-2.0
7.6.0-dev.20260826.sha.b71469b315 days ago3.4 MBApache-2.0
7.6.0-dev.20260825.sha.0fb2c13216 days ago3.4 MBApache-2.0

Overview

mongodb is an npm package that the official MongoDB driver for Node.js. It has 3 known dependents in the graph. The latest version is 7.6.0, released under the Apache-2.0 license.

Who should use it

Teams working in the npm ecosystem who need the official MongoDB driver for Node.js and value a focused solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (Apache-2.0).

Cons

  • Large dependency tree (59 direct dependencies) increases install size and audit surface.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use mongodb?

Yes — mongodb scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 16 days ago. 50 releases in the last 2 years.

How do I install mongodb?

Run `npm install mongodb` to add mongodb to your npm project.

How many dependencies does mongodb have?

mongodb declares 59 direct dependencies and pulls in 12 packages in total once its runtime tree is resolved totalling about 7.0 MB on disk.

What license is mongodb released under?

mongodb is distributed under the Apache-2.0 license. Its dependency tree also includes: Apache-2.0, BSD-2-Clause, MIT.

How popular is mongodb?

npm does not publish download counts. Within PackageGraph's crawl, 3 known packages depend on mongodb.

Is mongodb still maintained?

The most recent release of mongodb (v7.6.0) was published 16 days ago.

Does mongodb run install scripts?

No. mongodb does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.