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)