Working with databases can sometimes feel intimidating, but tools like MongoDB Compass make it much easier by providing a visual interface for managing and analyzing collections. In this blog, we’ll walk through some practical steps using screenshots from a sample yelpDB.reviews collection.
1. Viewing and Aggregating Documents
The first step is exploring the documents stored inside the reviews collection. MongoDB Compass provides an Aggregations tab that allows us to run aggregation pipelines visually.
2. Searching with Filters
Often, we need to filter reviews to find specific insights. Compass makes this easy with its filter bar.
3. Finding Documents by ID
If you want to look up a specific review or restaurant entry, you can filter using its business_id
4. Deleting Documents
Sometimes, data cleanup is necessary. In Compass, you can flag documents for deletion:
Select the document.
Click Delete.
Confirm deletion.
The document will be permanently removed from the collection.
5. Updating Documents
Compass also allows editing documents directly:
Click the pencil icon beside a field.
Modify the value (e.g., updating a business_id or correcting a review text).
Click Update to save the change.
CONCLUSION
Using MongoDB Compass, we performed key database operations visually:
Aggregating data (average ratings).
Filtering with regex.
Querying by IDs.
Deleting and updating documents.
Top comments (0)