In this video.
Let's finish up with the employee database by implementing what is called deleting an employee.
So back to the controller.
So here we go.
Let's collapse this one.
Or we can even copy the same code here and now inside the delete.
How?
Bring it here.
The difference here is going to be the mongoose method going to be fine by it and delete and we are
done.
Yes.
So for this one, I don't want to send back the deleted employee.
But let's say that in your front end you want to display the deleted employee, you can send back the
response.
But for me, no.
So I would say employee.
Has been deleted successfully.
And that is it.
So let me create an employee and then I'll go ahead and then delete that.
So I'll call this one as Lily.
And here we go.
Let me hit send.
Now let me find our employees.
You can see we have three employees.
So we have John Geneva.
And then Lily.
I want to remove Lily or I want to remove John Doe, so I'll copy this one.
And now let me locate the delete and I'll pass in the valid ID and hit send.
Now employee has been deleted successfully.
If I fetch our employees we can see that I go back to work and leave it.
So that is it.
Guy.
So here ends the complete section and express routing and then the MVC design pattern.
As we move on, we are going to build a complex application and that is income and expenses tracker
application using React and Node.js.
All right, let's go Rockin the Nest video.