I would like to deep populate a perhaps overcomplicated model
var ParentSchema = new Schema({
childs: [{type:Schema.ObjectId, ref: 'Child'}],
});
var ChildSchema = new Schema({
subject: [{
price: {type: Number},
data: {type: Schema.ObjectId, ref: 'Subject'}
}]
})
However, it doesn't seem to work when i use the regular population. I installed deep-populate now and use the following:
Parent.deepPopulate('childs.subjects');
I was wondering if there is perhaps an easier way to accomplish a populated array of subjects.