title: Mongoose/MongoDB - How to use promise with aggregate queries
body: <p>I am trying to perform 2 queries to 2 different collections in MongoDB via mongoose and then combine their results for a REST API response.</p>
  
  <p>Example:</p>
  
  <pre><code>var result1 = Model1.aggregate([&lt;operations here&gt;]).exec()
  
  var result2 = Model2.aggregate([&lt;operations here&gt;]).exec()
  
  var allDone = Promise.all(result1,result2)
  
  allDone.then(function(data1,data2){
  //Do something with both data
  })
  </code></pre>
  
  <p>I get this error
  TypeError: Cannot read property 'readPreference' of undefined</p>
  
  <p>Which used to happen when the function signature for the callback wasnt function(err,docs){... </p>
  
  <p>If I use callbacks for Aggregators , it works but I didn't want to chain callbacks/the queries and thought this way would be more efficient.</p>
  
  <p>I found this <a href="https://stackoverflow.com/questions/37016641/mongoose-aggregate-cursor-promise">Mongoose aggregate cursor promise</a></p>
  
  <p>But wanted to know if this is possible with native promises in a simpler way. 
  I do not want to iterate through the cursor too as explained in the above SO answer.</p>