Welcome back.
In this video, let's see how we can delete a record or to be more specific, how we can delete a student.
And the process is simple using MongoDB.
So here you go.
Const delete it.
Student equal to await my student collection.
And on that we have a method called delete one.
We have delete many and delete one delete many.
Delete multiple record and delete one delete a single record.
And for this we will pass in the student that we want to delete or a record that we want to delete.
So I want to delete a student by name boa.
That is my name.
I want to delete that and that is it.
So here, if I cancel log the delete student, I'm going to get a confirmation message that acknowledged.
So moment of truth.
So let me clear the terminate here and let me restart the file and let's see.
Yes, acknowledge deleted count one meaning that I have deleted one record.
So if I comment this one and I want to fetch all students and this is a record, let's find the method
for fetching or which is this one so I can go ahead and console.log the or students and let's see click
the terminal here and let's restart a file.
Let's see, I'm going to see two students and indeed there is no training but inside the array of students.
So guys, this how you can make use of crowd operation.