As a part of exploring MongoDB using MongoDB Compass—the friendliest GUI for Mongo's document store. I wanted to explore MongoDB beyond the shell, so I cooked up a mini “Yelp-style” reviews dataset in a local yelp DB. My goal? Get hands-on with real-world tasks: inserting sample data, running queries and aggregations, tweaking entries, performing deletions, and even exporting results as files.
Importing Dataset
For convenience, I prepared a small sample in JSON format—modelled after Yelp reviews. I then used the Add Data → Import Data feature in Compass to upload the JSON file.
Inserting Records Manually
To get hands-on, I also manually added at least 10 review entries with fields like business_id, name, rating, and review. This helped me understand data structure and ensure variety in entries.
Queries & Aggregations
Top 5 Businesses by Average Rating
Count of Reviews Containing the Word “good”
All Reviews for a Specific Business ID
Delete a Record
I selected a review and clicked the delete/trash icon to remove it. Compass prompted for confirmation and then removed the document.
Conclusion
By doing this practical exercise, I learned how to:
- Insert, query, update, and delete documents in MongoDB Compass
- Run aggregation pipelines to analyze data
- Use regex to search text fields
- Export results for further analysis
MongoDB’s flexible schema and Compass’s visual interface make it a powerful pairing for real-world data tasks.
Top comments (0)