【发布时间】:2019-07-28 16:33:16
【问题描述】:
所以基本上我正在尝试从 header.ejs 访问 Pages 集合
app.use(function(req,res,next){
res.locals.pages= Pages.find();
next();
});
但是当我尝试从 html 访问它时,它会显示 [object object]
当我在 console.log 上显示它时,它显示了很多
createIndexes instead.
Query {
_mongooseOptions: {},
_transforms: [],
_hooks: Kareem { _pres: Map {}, _posts: Map {} },
_executionCount: 0,
mongooseCollection:
NativeCollection {
collection: Collection { s: [Object] },
opts:
{ bufferCommands: true,
capped: false,
'$wasForceClosed': undefined },
name: 'pages',
collectionName: 'pages',
conn: ....................
如何通过数组从 html 访问?
【问题讨论】:
标签: mongodb express mongoose schema mongoose-schema