How can I populate the show property in a Schema like this:
var userSchema = new Schema({
email: String,
displayName: String,
subscriptions: [{
show: {type: Schema.Types.ObjectId, ref: 'Show'},
favorite: {type: Boolean, default: false}
}]
});
I've tried something like this
User.findOne({displayName: 'bill'})
.populate('subscriptions.show')
.exec(function(err, user) {
console.log(user);
});
It does nothing to populate it. I get something like this returned
{
_id: 53a7a39d878a965c4de0b7f2,
email: 'te...@test.com',
displayName: 'bill',
__v: 1,
subscriptions: [{
_id: 53a7a39d878a965c4de0b7f3,
favorite: false
}]
}