Create a web app that displays a single Collection(Table) from MongoDB as a Table in HTML using ExpressJS which is a NodeJS Node.js web application framework. We can then Insert, Modify and Delete records from the HTML page.
- Clone repo
- run
npm install
- run
npm run start
- Navigate to
localhost:3000
Change Database
use <DatabaseName>
Show the existing collections
show tables
Insert the first record into the collections "customers".
db.customers.insert({ "name" : "user1", "email" : "user1@webapp.com", "phone": "1234567890"})
Display the contents of the Collection
db.customers.find().pretty()
Removing record from a collection
db.customers.remove({'name' :"user1"})
Reference - https://zellwk.com/blog/crud-express-mongodb/