Answers for "show data of mongoose in html page using ejs"

0

show data of mongoose in html page using ejs

app.get('/profileface', isLoggedIn, function(req, res) {
    // mongoose operations are asynchronous, so you need to wait 
    PracticeModel.find({}, function(err, data) {
        // note that data is an array of objects, not a single object!
        res.render('profileface.ejs', {
            user : req.user,
            practices: data
        });
    });
});
Posted by: Guest on May-25-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language