DEV Community

Cover image for πŸŽ‰ MongoDB Atlas CRUD Operations Made Easy! πŸš€
ROHITH
ROHITH

Posted on

πŸŽ‰ MongoDB Atlas CRUD Operations Made Easy! πŸš€

Hey folks! Today, let's play with MongoDB Atlas and Compass UI to handle our student database through CRUD operations: Create, Read, Update, and Delete. Ready? Let’s jump in! πŸŠβ€β™‚οΈ

🟒 1. Create – Adding New Students!
Want to add a new student to your collection? Just click β€œInsert Document” and fill in the details for your student, like student_id, name, department, year, cgpa, and age. Hit the save button and boom – your student joins the list! ✨

πŸ” 2. Read – Finding Students With Filters

Curious to know which students have a CGPA greater than 8? Just use a filter like:

{ cgpa: { $gt: 8 } }
MongoDB Compass instantly grabs the matching documents for you! 🎯

(See example filter and the highlight of top performers!)

( find students only in the IT department? Use:
{ department: "IT" }
(Here’s the query result filtered for IT students!)

πŸͺ„ 3. Update – Make a Change!

Need to update a student’s CGPA? Easy! Search for the student by student_id (like S005), click the field (say, CGPA), edit it, and save. The new score is live! πŸ“

(Watch updating a student's CGPA in action!)

πŸ—‘οΈ 4. Delete – Say Goodbye!

Want to remove a record? Just filter by student_id, click the delete option, and confirm! The document will be flagged for deletion, and once confirmed, it’s wiped from the collection. No more clutter! 🧹

(See the deletion process and confirmation popup!)

CRUD operations in MongoDB Atlas using Compass are super friendly and visual. You can build, explore, modify, and clean your data – all with just a few clicks and simple queries. Hope these screenshots made each step clearer! 🚦

Ready to take control of your data? Drop questions below or share your own CRUD hacks! πŸ™Œ

Top comments (0)