how to get data from mongoose in node js code example
Example: mongoose and express get requests
app.get('/api/all', (req,res) =>{
Model.find({})
.then(model=> {
res.json(model)
}).catch(error=>{
res.json(error)
}
})
})