title: How can I store data other than ObjectId using Mongoose populate?
body: <p>Taking the example from here</p>
  
  <p><a href="http://mongoosejs.com/docs/populate.html" rel="nofollow">http://mongoosejs.com/docs/populate.html</a></p>
  
  <p>If I try to tweak it so that 'fans' also contains a rating</p>
  
  <pre><code>var db = require('houselib/db');
  var Schema = db.Schema;
  var mongoose = db.mongoose;
  
  var PersonSchema = new Schema({
      name    : String
      , age     : Number
      , stories : [{ type: Schema.ObjectId, ref: 'Story' }]
  });
  
  var StorySchema = new Schema({
      _creator : { type: Schema.ObjectId, ref: 'Person' }
      , title    : String
      , fans     : [{ type: Schema.ObjectId, ref: 'Person', rating: Number}]
  });
  
  var Story  = mongoose.model('Story', StorySchema);
  var Person = mongoose.model('Person', PersonSchema);
  
  var aaron = new Person({ name: 'Aaron', age: 100 });
  
  aaron.save(function (err) {
      if (err) throw err;
  
    var story1 = new Story({
        title: "A man who cooked Nintendo"
      , _creator: aaron._id
      , fans: [{type: aaron._id, rating: 4}]
    });
  
    story1.save(function (err) {
      if (err) throw err;
          Story
          .find({ _creator: aaron._id })
          .populate('_creator') // &lt;-- not really necessary
          .run(function (err, stories) {
              if (err) throw err;
              console.log('The stories JSON is an array: ', stories);
          })
    });
  
  })
  </code></pre>
  
  <p>I get the following error</p>
  
  <blockquote>
    <p>CastError: Cast to undefined failed for value "[object Object]"</p>
  </blockquote>