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}}}}).