Multiple Mongoose Queries before rendering view
<p>I've a form with multiple dropdown lists that needs to be populated with values from MongoDB database, in my route file code seems something like this:</p>

<pre><code>Make.find({},function(err,allMakes){
       if(err){
           console.log("error while trying to get all makes from the database");
       }else{
           makes = allMakes;
}

Color.find({},function(err,allColors){
       if(err){
           console.log("error while trying to get all colors from the database");
       }else{
           colors = allColors;
}
</code></pre>

<p>I've 8 occurrences where i need to query the DB then put the result in local variable in order to pass it to render function as a param like this:</p>

<pre><code>res.render("viewname",{makes:makes,colors:colors....etc}); 
</code></pre>

<p>the problem is that in my view file i get undefined for the params.</p>

<p>any solutions for the asynch nodejs code?!</p>