DEV Community

Md Razibul
Md Razibul

Posted on • Edited on

CRUD Operation with Node and Mongodb

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.

Image description

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.

Image description

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.

Image description

Delete-Method

Image description

Image of Wix Studio

2025: Your year to build apps that sell

Dive into hands-on resources and actionable strategies designed to help you build and sell apps on the Wix App Market.

Get started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay