NoSQL_Lab_MongoDB_Submission
NoSQL_Lab_MongoDB_Submission
2. Installing MongoDB
Windows Installation:
1. Download MongoDB Community Edition from MongoDB Official Website
Linux Installation:
Run the following commands:
Install PyMongo:
pip install pymongo
import pymongo
client = pymongo.MongoClient('mongodb://localhost:27017/')
db = client['LibraryDB']
collection = db['books']
collection.insert_one({'title': '1984', 'author': 'George Orwell', 'year': 1949, 'category':
'Dystopian'})
books = collection.find()
for book in books:
print(book)
6. Assignment Tasks
• Installed MongoDB and MongoDB Compass ✅