Have you ever wanted to get your hands dirty with NoSQL but didn't want to deal with the hassle of local installations, environment variables, or npm errors?
In this guide, we'll go from zero to a fully functional database in minutes using MongoDB Atlas. We'll create a cluster, insert data, and perform advanced queries—all within your web browser.
What we will cover:
- Setting up a free Cloud Cluster
- Creating a Database & Collection
- Inserting Dummy Data (JSON)
- Running Aggregation Pipelines
- Filtering with Regex (Pattern Matching)
- Updating and Deleting documents
Let's dive in! 🚀
1. Create a Free MongoDB Atlas Cluster
First, we need a server. Luckily, MongoDB provides a "forever free" tier.
- Navigate to cloud.mongodb.com
- Sign up (or sign in using Google/GitHub)
- Click + Create (or Build a Cluster)
- Select the Shared (FREE) option
- Choose the M0 Sandbox tier
- Click Create User (Save your password!) and then Create Cluster
Note: It may take 1-3 minutes for the cluster to provision.
2. Create Database & Collection
Once your cluster is green and Active:
- Click the Browse Collections tab
- Select + Create Database
- Enter the following:
-
Database Name:
nosql_hands_on -
Collection Name:
reviews
-
Database Name:
- Click Create
3. Insert at Least 10 Documents Manually
Now, let's populate our collection with sample reviews.
- Inside the
reviewscollection, click Insert Document - Switch the view to {} JSON (top right of the modal)
- Paste each document below (or paste as an array if comfortable):
{
"business_id": "BIZ_001",
"user_id": "U1",
"rating": 4.8,
"review_text": "Amazing food, really good taste!",
"date": "2024-11-10"
}
{
"business_id": "BIZ_001",
"user_id": "U2",
"rating": 4.5,
"review_text": "Very good ambience.",
"date": "2024-10-01"
}
{
"business_id": "BIZ_002",
"user_id": "U3",
"rating": 3.2,
"review_text": "Food was average, not very good.",
"date": "2024-09-15"
}
{
"business_id": "BIZ_002",
"user_id": "U4",
"rating": 4.0,
"review_text": "Good service. Quick delivery.",
"date": "2024-08-21"
}
{
"business_id": "BIZ_003",
"user_id": "U5",
"rating": 2.9,
"review_text": "Not good. Long waiting time.",
"date": "2024-08-02"
}
{
"business_id": "BIZ_003",
"user_id": "U6",
"rating": 3.5,
"review_text": "Decent place but not good enough to come again.",
"date": "2024-07-10"
}
{
"business_id": "BIZ_004",
"user_id": "U7",
"rating": 4.9,
"review_text": "Outstanding! Really good customer service.",
"date": "2024-06-14"
}
{
"business_id": "BIZ_004",
"user_id": "U8",
"rating": 3.8,
"review_text": "Pretty good but expensive.",
"date": "2024-05-05"
}
{
"business_id": "BIZ_005",
"user_id": "U9",
"rating": 4.4,
"review_text": "Good portion size and good staff.",
"date": "2024-04-08"
}
{
"business_id": "BIZ_005",
"user_id": "U10",
"rating": 3.9,
"review_text": "Good but could be improved.",
"date": "2024-03-11"
}
4. Query 1 — Top 5 Businesses by Average Rating
Let's find the businesses with the highest ratings using the Aggregation Framework.
- Click the Aggregation tab
- Click Create Pipeline (or select "Text" view)
- Paste the following pipeline:
[
{ "$group": { "_id": "$business_id", "avgRating": { "$avg": "$rating" } } },
{ "$sort": { "avgRating": -1 } },
{ "$limit": 5 }
]
Breakdown:
-
$group: Groups reviews bybusiness_id, calculates average rating -
$sort: Sorts descending (highest first) -
$limit: Keeps top 5
5. Query 2 — Count Reviews Containing the Word "good"
Let's search for reviews that mention "good", regardless of capitalization.
Option A – Using Filter Bar
Go to Documents tab, then use the Filter:
{ "review_text": { "$regex": "good", "$options": "i" } }
Click Apply to see filtered results.
Option B – Using Aggregation Count
[
{ "$match": { "review_text": { "$regex": "good", "$options": "i" } } },
{ "$count": "good_review_count" }
]
Tip: $options: "i" makes it case-insensitive.
6. Query 3 — Get Reviews for a Specific Business ID
To filter all reviews for a specific business:
In the Documents tab, use the Filter:
{ "business_id": "BIZ_001" }
Click Apply.
7. Update a Document (Using Query)
Let's say User U3 changed their mind and wants to update their review.
Click the <> (Mongosh) icon at the bottom of the page or use the Playground, then run:
use nosql_hands_on
db.reviews.updateOne(
{ "user_id": "U3" },
{
$set: {
"rating": 4.5,
"review_text": "Updated review — food quality improved, now very good."
}
}
);
You should see: { acknowledged: true, modifiedCount: 1 }
8. Delete a Document
Let's remove a review from the collection.
Method 1: Using UI
- Go to the Documents tab
- Find the document for user
U10 - Click the Trash Can Icon (Delete)
- Confirm deletion
Method 2: Using Shell/Playground
Run this command in Mongosh:
db.reviews.deleteOne({ "user_id": "U10" });
You should see: { acknowledged: true, deletedCount: 1 }
9. Conclusion
Congratulations! 🎉 You've successfully performed all core NoSQL operations using MongoDB Atlas—entirely in your browser, without installing any local tools.
What we accomplished:
✓ Created a free MongoDB Atlas cluster
✓ Created a database and collection
✓ Manually inserted 10+ documents
✓ Ran aggregation pipelines to find top businesses
✓ Filtered data using regex pattern matching
✓ Queried specific business reviews
✓ Updated documents using queries
✓ Deleted documents
This workflow is ideal for students, beginners, and anyone who wants to learn MongoDB without the complexity of local installations. The Atlas UI provides a powerful interface for data exploration and manipulation.
Happy Coding! 🚀
Next Steps: Want to go deeper? Explore MongoDB's official documentation for advanced aggregation operators, indexing strategies, and performance optimization!











Top comments (0)