The official MongoDB driver for Node.js and TypeScript, used to connect to MongoDB and run queries from application code.
mongodb/mongo
MongoDB, the source-available document database server (mongod) with the mongos sharding router, written in C++.
Open-source alternative to:Amazon DocumentDB
- Stars
- 28,656
- Forks
- 5,843
- Open issues
- 37
- Last commit
- 3 hours ago
What is it?
MongoDB is a NoSQL document database. This repository contains the source for the database server, mongod, which stores and serves data, and mongos, a sharding router that distributes data and queries across a sharded cluster.
The project covers building the server from source, running a single-node database locally with the mongosh shell, and installing MongoDB Compass, the graphical client. Client drivers for most programming languages are maintained separately and are linked from the official documentation, and packaging scripts produce RPM and Debian packages.
Source is published under the Server Side Public License (SSPL) for releases after October 16, 2018, with earlier releases under the AGPL. Individual files carry headers indicating which license applies.
Key features
- 01Document-oriented NoSQL database server (mongod)
- 02Sharding router (mongos) for distributing data across a cluster
- 03Shell access through mongosh, with help and command-line options
- 04Compass graphical client installable via a bundled script
- 05Build-from-source instructions and RPM/Debian packaging scripts
Use cases
- Storing application data as flexible JSON-like documents
- Scaling a database horizontally with sharding
- Running a self-hosted MongoDB server built from source
- Building or customizing the MongoDB server itself
Quick start
- 1
Download MongoDB from the official download page or install via Homebrew
brew tap mongodb/brew - 2
Create the default data directory
sudo mkdir -p /data/db - 3
Start the mongod database server
./mongod - 4
Connect with the mongosh shell
./mongosh
Things to know
- The license is the Server Side Public License (SSPL), which is source-available rather than an OSI-approved open-source license.
- Building from source is a non-trivial process documented separately in docs/building.md.
Topics
FAQ
- What is mongo?
- MongoDB, the source-available document database server (mongod) with the mongos sharding router, written in C++. MongoDB is a NoSQL document database. This repository contains the source for the database server, mongod, which stores and serves data, and mongos, a sharding router that distributes data and queries across a sharded cluster.
- Is mongo free to use? What license does it have?
- mongo is open source under the Other license. Check the license terms before using it in commercial products.
- Is mongo still maintained?
- Actively maintained. The last commit to mongo was on Oct 21, 2026.
- What can I use mongo for?
- Storing application data as flexible JSON-like documents Scaling a database horizontally with sharding Running a self-hosted MongoDB server built from source Building or customizing the MongoDB server itself
- How do I install mongo?
- Download MongoDB from the official download page or install via Homebrew: brew tap mongodb/brew Create the default data directory: sudo mkdir -p /data/db Start the mongod database server: ./mongod Connect with the mongosh shell: ./mongosh
- Where can I get mongo?
- The source code and installation instructions are on GitHub: https://github.com/mongodb/mongo
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An in-memory data store used as a cache, data structure server, document store, vector database, and message broker.
TypeScript ORM for Node.js that gives type-safe database access across PostgreSQL, MySQL, SQLite, MongoDB and other databases.
A multi-model database written in Rust that combines document, graph, relational, time-series, and key-value data with realtime queries and built-in access control.
An in-memory data store that is API-compatible with Redis and Memcached, aiming to be a drop-in replacement for both.
MongoDB object modeling for Node.js, providing schemas, models, validation, and query helpers for async applications.