What is MongoDB?
MongoDB is a document database. Instead of tables with fixed columns, it stores flexible, JSON-like documents. Each document can have a different shape, which makes it easy to evolve your data as your app grows without rigid migrations.
When should you use it?
Choose MongoDB when your data is naturally document-shaped (a blog post with nested comments, a product with varying attributes), when your schema changes often, or when you want to start fast without designing tables up front. It is popular with JavaScript developers because documents look just like JS objects.
How to set it up
Run locally with Docker: docker run -p 27017:27017 mongo, or use the free hosted tier of MongoDB Atlas (their managed cloud) to skip setup entirely.
How it connects to your code
From Python use pymongo; from Node.js use the official mongodb driver or Mongoose. You work with collections of documents and query them with a JSON-like syntax: db.users.find({{"age": {{"$gt": 18}}}}).
MongoDB Reference Topics 12 planned
These are the topics planned for this reference. They are not written yet — the list is published so you can see what is coming. Everything already complete on this site is linked from the Languages section.
Origin (2007, 10gen), document model, and where it fits vs. SQL.
Guide in progressLocal install, Docker, or the fully managed MongoDB Atlas.
Guide in progressMongoDB's equivalent of rows and tables — without a fixed schema.
Guide in progressinsertOne, find, updateOne, deleteOne — MongoDB's core API.
Guide in progressQuery operators like $gt, $in, and nested-field matching.
Guide in progressSingle-field, compound, and text indexes.
Guide in progressMongoDB's stage-based alternative to SQL's GROUP BY.
Guide in progressEmbedding vs. referencing — MongoDB's core modeling decision.
Guide in progressMulti-document ACID transactions since MongoDB 4.0.
Guide in progressReplica sets for availability, sharding for horizontal scale.
Guide in progressQuery planning, the explain() method, and index coverage.
Guide in progressOfficial drivers and ODMs like Mongoose.
Guide in progress