title: Mongoose populate nested array
body: <p>Assuming the following 3 models:</p>
  
  <pre><code>var CarSchema = new Schema({
    name: {type: String},
    partIds: [{type: Schema.Types.ObjectId, ref: 'Part'}],
  });
  
  var PartSchema = new Schema({
    name: {type: String},
    otherIds: [{type: Schema.Types.ObjectId, ref: 'Other'}],
  });
  
  var OtherSchema = new Schema({
    name: {type: String}
  });
  </code></pre>
  
  <p>When I query for Cars I can populate the parts:</p>
  
  <pre><code>Car.find().populate('partIds').exec(function(err, cars) {
    // list of cars with partIds populated
  });
  </code></pre>
  
  <p>Is there a way in mongoose to populate the otherIds in the nested parts objects for all the cars.</p>
  
  <pre><code>Car.find().populate('partIds').exec(function(err, cars) {
    // list of cars with partIds populated
    // Try an populate nested
    Part.populate(cars, {path: 'partIds.otherIds'}, function(err, cars) {
      // This does not populate all the otherIds within each part for each car
    });
  });
  </code></pre>
  
  <p>I can probably iterate over each car and try to populate:</p>
  
  <pre><code>Car.find().populate('partIds').exec(function(err, cars) {
    // list of cars with partIds populated
  
    // Iterate all cars
    cars.forEach(function(car) {
       Part.populate(car, {path: 'partIds.otherIds'}, function(err, cars) {
         // This does not populate all the otherIds within each part for each car
       });
    });
  });
  </code></pre>
  
  <p>Problem there is that I have to use a lib like async to make the populate call for each and wait until all are done and then return.</p>
  
  <p>Possible to do without looping over all cars?</p>