MongoDB is a NoSQL database that stores data in JSON-like documents instead of tables. It is highly scalable, flexible, and schema-less, making it ideal for modern web and mobile applications.
MongoDB follows a client-server architecture with the following components:
✅MongoDB Server → Manages the database.
✅Database → A collection of related data.
✅Collections → Groups of documents (similar to tables).
✅Documents → JSON-like objects storing data.
✅Fields → Key-value pairs inside a document.
To install MongoDB on Windows / macOS / Linux:
✅ Download MongoDB from the official website.
✅Install and start MongoDB Server (mongod command).
✅Connect using MongoDB shell (mongosh).
✅Checking MongoDB Version
✅Starting the MongoDB Shell
✅Show all Databases
✅Create or Switch to a Database
.
✅Show Collections (Tables in SQL)
✅Create (Insert Data into MongoDB)
✅Read (Find Data in MongoDB)
✅Update (Modify Existing Documents)
✅Delete (Remove Documents)
Indexes improve query performance by reducing scan time.
The aggregation framework helps process and analyze large datasets.
MongoDB supports two types of relationships:
✅Embedded Documents (Denormalization) → Stores related data inside a single document.
✅Referencing (Normalization) → Links documents using an _id field.
MongoDB Atlas is a fully managed cloud database.
✅Steps to Use MongoDB Atlas:
✅Sign up for MongoDB Atlas.
✅Create a new cluster.
✅Connect to the cluster using MongoDB Compass or a programming language.
MongoDB is a powerful NoSQL database that provides flexibility, scalability, and high performance for modern applications. It is widely used in e-commerce, IoT, social media, and big data applications.