title: Get data from multiple collections in mongoose?
body: <p>I have two collections, namely Orders and Employee. I first find all orders from Orders collection of a certain customer using the customer id and then need to use a field from the result to find data from Employee collection. The problem I am facing is result that I get from Orders is an array so I need to iterate through it using a for loop and then inside the for loop find the Employee data. The first part of orders works but the second doesn't it always me a 0 array value.</p>
  
  <pre><code>        async.waterfall([
          function(callback) {
              Order.find({ user_id: req.body.id}, {sort: { id: -1 }}, function(err, order) {
                  callback(null, order);
              });
          },
          function(order, callback) {
              for(var i = 0; i &lt; order.length; i++) {
                  Employee.find({id: order[i].id}, 'field', function(err, employee) {
                      if (employee.length &gt; 0) {
                          order[i].field = employee[i].field;
                      }
                      order[i].id = order[i].otherid;
                      regs.push(order[i]);
                  });
              callback(null, regs);
              }
          }], function (err, result) {
              res.send(result);
          });
  </code></pre>
  
  <p>But the result is this: [0], which is not the expected result. What am I doing wrong here?
  Any other solutions?? </p>