#CRUD Operations with MongoDB, Express and Node.js
-
Install MongoDB
https://docs.mongodb.com/manual/administration/install-community/
-
Install Node
-
Install Express
In the same directory as the server.js file, run this on command prompt:
npm install express
-
Install Body-Parser
In the same directory as the server.js file, run this on command prompt:
npm install body-parser
-
Install Mongoose
In the same directory as the server.js file, run this on command prompt:
npm install mongoose
-
Install Postman extension on Chrome
-
Run MongoDB
In the prompt command, run:
mongod
-
Run the server application
In the same directory as the server.js file, run this on command prompt:
node server
-
To test, run the following methods on Postman
GET
PUT
POST
DELETE
The URL can be:
or:
http://localhost:3000/user/:id
:id = id of the user you want to select, update or delete