So I'm new to MongoDB.
I am developing a website that I would like to GET data from a MongoDB collection based on a {Name: String} within that Collection and display it in an HTML Table.
This is what i have:
- An Index.js file (server side js)
- I have a MongoDB Collection called CustomersDB that has some data (documents) in it (i wrote code that saves it in this Customers collection and it works)
What i need:
What kind of code do I write in my index.js file for app.get('/customers') that would allow me to GET the data from the collection and display it in a table in my customers.ejs file.
The languages and others that I am using for this is: Node.js, Express , EJS, Body Parser, Cors and MongoDB
Copyright Notice:Content Author:「Eugene Koen」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59748996/display-mongodb-collection-data-in-html