⬅ Previous Topic
Installing MongoDB on MacYou can support this website with a contribution of your choice.
When making a contribution, mention your name, and programguru.org in the message. Your name shall be displayed in the sponsors list.
⬅ Previous Topic
Installing MongoDB on MacMongoDB Atlas is a fully managed cloud database service provided by MongoDB. It lets you create, manage, and scale MongoDB clusters in the cloud (AWS, GCP, or Azure) without setting up a local database manually.
It’s perfect for beginners who want to practice MongoDB from anywhere, without the hassle of installations.
Go to https://www.mongodb.com/cloud/atlas/register and create a free account.
Cluster0 is being created... Your cluster will be ready in 1-3 minutes.
0.0.0.0/0
(for learning purposes only)Q: Why do I need to whitelist my IP in MongoDB Atlas?
A: Atlas uses IP whitelisting to protect your data. Only allowed IPs can access the cluster, adding a layer of security.
Example connection string:
mongosh "mongodb+srv://cluster0.abcde.mongodb.net/" --username yourUser
Enter password: ****** Current Mongosh Log ID: ... Connecting to: mongodb+srv://cluster0...
You are now connected to your MongoDB cluster in the cloud!
use myCloudDB
db.createCollection("students")
{ ok: 1 }
db.students.insertOne({
name: "Riya",
course: "MongoDB",
enrolled: true
})
{ acknowledged: true, insertedId: ObjectId("...") }
db.students.find()
[ { _id: ObjectId("..."), name: "Riya", course: "MongoDB", enrolled: true } ]
Q: Can I connect this cluster to my Node.js app or Python script?
A: Absolutely! MongoDB Atlas gives you a connection string which you can plug into your backend code using libraries like Mongoose
(Node.js) or PyMongo
(Python).
In the next lesson, we’ll explore the MongoDB Compass GUI — a visual way to interact with your Atlas data.
⬅ Previous Topic
Installing MongoDB on MacYou can support this website with a contribution of your choice.
When making a contribution, mention your name, and programguru.org in the message. Your name shall be displayed in the sponsors list.