All Guides
MongoDB Setup
Install MongoDB NoSQL database and learn basic CRUD operations.
Intermediate20 min
Setup Steps
1. Add MongoDB GPG key:
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | sudo gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg2. Add repository:
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list3. Install MongoDB:
sudo apt update
sudo apt install mongodb-org -y4. Start the service:
sudo systemctl start mongod
sudo systemctl enable mongod5. Connect to MongoDB shell:
mongosh6. Create a database and collection:
use myapp
db.users.insertOne({name: "Ali", email: "ali@test.com"})7. Query data:
db.users.find()
db.users.find({name: "Ali"})8. Enable authentication:
use admin
db.createUser({user: "adminuser", pwd: "Password123!", roles: ["root"]})9. Set security.authorization: enabled in /etc/mongod.conf
Related Guides
MySQL Database Setup
Install MySQL database server, secure it and learn basic operations.
PostgreSQL Setup
Install and configure PostgreSQL database server.
Redis Setup
Install Redis in-memory data store. Caching and session management.
Prisma ORM Setup
Add Prisma ORM to your Node.js project. Schema definition, migration and CRUD operations.