hello guys how are you? i think you all are fine. do you know about crud operation with node,express and mongodb. you well done. if don't know. hey let's start with me.
at you need to install node in your computer. then make directory in your computer. also install express and mongodb. then run your vs code terminal npm init command.
C=Create
R=Read
U=Update
D=Delete
Create-Method
First I will discuss about C, which means Create Method. We can send data to the server using the Post method. Notice below the code block.
The post method take two parameter req and res object. Then we can req server then server response us.
Read-Method
The Read method means we can get something from the server. Where we need to use the get method.
Notice the code block the get method also takes the req and res method . we can request to server for data then server send data us.
Update Method
We use the Put method to update something. Which takes two parameters req and res.
We have to use $Set to update items. Which property will be updated we need to the property in the $Set.
Delete-Method
Top comments (0)