Skip to content

ayushtiwari24/Crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

//mini project to perform crud operations using mongodb and mongoose.

--- steps ----

1.Install mongodb on the system from official site of mongodb (version used - 4.8.1)

  1. commands used for installation of express ,mongoose and nodemon --> npm install express (version- 4.18.1) -->npm install mongoose (version -6.5.2) --> npm install nodemon (version- 2.0.19)

3.made connection with database using mongoose in app.js.

  1. created product.js file in models folder in which schema for the productDB database is created.

  2. Created productController.js file in controllers folder --> created functions to getAllproducts , getProduct , updateProduct and deleteProduct -->used product.find() to get all products from the database --> used product.findById() to get a single product , update a single product and delete a product.

  3. created products.js in routes folder for routing --> used get method to get produts from database --> post method to add data in the database --> patch to update data -->delete to delete data

--> Type npm start in terminal for starting project .

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published