Is it possible to query a returned collection in mongoose for mongodb. So in the example below I wish to return to the page the full list of steps, as well as the currentStep. The line I am unsure about is currentStep: steps.?????(page).
Thanks
var page = (req.params.page == undefined?1:req.params.page)
db.stepModel.find().sort({number:1}).exec(function(err, steps) {
if (err) { return next(err); }
res.render('scheme', {
title: 'Fnol',
user: req.user,
steps:steps,
currentStep: steps.?????(page),
page:page
});
};