I hope the heading describes my question right.
When I open /admin/liste, it should render two tables from MongoDB database. How can I render two or more collections?
app.get('/admin/liste', isLoggedIn, function(req, res) {
var List1 = mongoose.model('List1');
// var List2 = mongoose.model('List2');
List1.find(function (err, docs) {
res.render('admin/liste',{
firstlist : docs
});
});
/*List2.find(function (err, docs) {
res.render('admin/liste',{
seclist : docs
});
});*/
});
EDIT: I can't find any information to my problem in the reference, that this question is dublicate. I'm not using any Joins or something like that. I want to display two tables from the items which are in List1 and List2. The uncommented out code is working well, but this is only one table, so I have to combine those two, then render the page.
Hope anyone can help me, thank you.