I have Category
model:
Category:
...
articles: [{type:ObjectId, ref:\'Article\'}]
Article model contains ref to
This concept is deep Population. Here Calendar,Subscription,User,Apartment are mongoose ODM models in different levels
Calendar.find({}).populate({
path: 'subscription_id',model: 'Subscription',
populate: {path: 'user_id',model: 'User',
populate: {path: 'apartment_id',model: 'Apartment',
populate: {path: 'caterer_nonveg_id',
model: 'Caterer'}}}}).exec(function(err,data){
if(!err){
console.log('data all',data)
}
else{
console.log('err err err',err)
}
});