DEV Community

nguyennobita9999
nguyennobita9999

Posted on

Get more collection in mongodb output page home ?

function index(req , res , next){

db.collection("product").find({}).toArray(function(err , product){

db.collection("banner").find({}).toArray(function(err , banner){

db.collection("newest").find({}).toArray(function(err , newest){

  return res.render("/index" , {product : product ,banner : banner , newest : newest}); 
})

})
})

}

Please help me?

Top comments (0)