Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
        });
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #show #data #mongoose #html #page #ejs
ADD COMMENT
Topic
Name
6+7 =