Currently using node.js along with mongoose and express. I have two collections in my MongoDB and I can successfully retrieve data like this:
ActivityList.prototype = {
showActivities: function(req, res) {
point.find({}, function foundPoints(err, items) {
res.render('index2',{title: 'Credits' , points: items})
});
}
These data can be treated in my index.jade like this:
form(action="/asdad", method="post")
select(name = "item[point]")
each point in points
option(value='onlytesting') #{point.Activity}
input(type="submit", value="Update tasks")
As you can see I am using this to fill a drop down menu.. My issue is that i want to fill multiple drop down menus with data from other collections also.
The page is supposed to be my index.jade, such that a user is presented with multiple drop down menus which will be pulled directly from MongoDB.
My app.js calls:
app.get('/', activityList.showActivities.bind(activityList));
That works just fine, but I want to be able to fetch other data also with the "same" get..
Does anyone know how this can be accomplished? Thanks for any tips