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)