916 B
916 B
Introduction to MongoDB
This task focuses on understanding MongoDB, a popular NoSQL database used in modern web applications. Unlike traditional relational databases, MongoDB stores data in a flexible, JSON-like format.
MongoDB Structure
| Level | Description |
|---|---|
| Database | Contains collections |
| Collection | Group of documents (like a table) |
| Document | JSON-like data (like a row) |
Example Document
{
"name": "Rupesh",
"age": 23,
"course": "MCA",
"skills": ["JavaScript", "Node.js"]
}
Installation Steps
- Download MongoDB from official website
- Install MongoDB Community Edition
- Start MongoDB server:
mongod
- Open Mongo shell:
mongosh
Basic Commands
show dbs
use studentDB
show collections