so basically i'm trying to access Pages collection from header.ejs
app.use(function(req,res,next){
res.locals.pages= Pages.find();
next();
});
but when i try to access it from the html it display [object object]
and when i display it on console.log it shows a lot
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: ....................
how can i access from html by array ?