title: populate with objects in array - mongoose
body: <p>I have two collections:</p>
  
  <pre><code>//col1
  var schema1 = new mongoose.Schema({
                _id: ... ,
                name1: String,
                objects1: [{
                  _id: ... ,             &lt;-- reference to this !!!!!!!!!!!!!!              
                  obj_name: String                            
                }]
  });
  
  //col2
  var schema2 = new mongoose.Schema({
                _id: ... ,
                name2 : String,
                objects2 : [{
                  _id: ... ,
                  _source: {type: mongoose.Schema.ObjectId, ref: 'col1'}
                }]
  });
  </code></pre>
  
  <p>If I do something like</p>
  
  <pre><code>schema.statics.getByName = function(name, callback) {
      mongoose.model('col2').findOne({ name2 : name }).populate('objects2').exec(callback);
  };
  </code></pre>
  
  <p>the return object gets not populated.</p>
  
  <p>I'm quite sure the problem is, that the object i'm refering to is stored in an array, and that its not a document id.</p>
  
  <p>I tried to solve this by doing <code>_source: {type: mongoose.Schema.ObjectId, ref: 'col1.objects1'}</code> but without any effect.</p>
  
  <p>Any ideas?</p>