【发布时间】:2012-08-09 03:32:22
【问题描述】:
我一直试图在我的玉视图中获取 mongodb 数据。我是 node.js 的新手,如果这看起来很愚蠢,我深表歉意! 我可以在控制台中查看我的表格中的内容:
Material.find(function (err, materials){
console.log(materials);
});
但我想将该数据传递给我的玉视图
app.get('/help', function(req, res){
res.render('help', {materials: materials});
});
我该怎么做?
【问题讨论】:
标签: node.js mongodb mongoose pug