title: Performing asynchronous operation within bluebird promise
body: <p>So, I've been beating this one about for a few days and I'm stumped as to what is the best way to solve it.  I am using Waterline/dogwater with HAPI and trying to do something broadly like so:-</p>
  
  <pre><code>wardrobe.find({WardrobeId: 5}).then(function(clothes) {
      //got my clothes in my wardrobe.
      clothes.find({Type: 'trousers'},{Kind: 'nice ones'}).then(function(trousers) {
          //got my nice trousers
          _.each(trousers, function(trouser) {
              //logic to see if these are my pink trousers
              console.log('color?', trouser.color);
          });
          console.log('ding');
      });
  });
  </code></pre>
  
  <p>The trouble I have is the code will always <code>ding</code> before it outputs the trouser colors. This is because, as much as I understand it, <code>_.each</code> will make the code go async.  I tried to introduce Promises (bluebird), but without luck. I even looked at generators (Co), but my node version is fixed at pre v0.11.</p>
  
  <p>I'd like to perform some database look-ups within the <code>_.each</code>, return these results (if any) to the trouser object, which can then be returned:-</p>
  
  <pre><code>wardrobe.find({WardrobeId: 5}).then(function(clothes) {
      //got my clothes in my wardrobe.
      clothes.find({Type: 'trousers'},{Kind: 'nice ones'}).then(function(trousers) {
          //got my nice trousers
          _.each(trousers, function(trouser) {
              //logic to see if these are my pink trousers
              db.colors.find({Color: trouser.color}).then(function(color) {
                  //color here?
              });
          });
          console.log('ding');
      });
  });
  </code></pre>
  
  <p>What is the best way to do this as efficiently as possible?</p>
  
  <p>Help is appreciated.  Happy to return here and focus the question where needed.</p>