You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mongoose I'm using is version 3.6.7.
Simply speaking, the model timeline has a yell which has a user.
I followed the gist mentioned in the release note to do nested population through 'Model.populate' but got null for for inner level population (timeline.yell.user => null). If I do the inner population document by document through 'Document.populate', I can get the expected result. If there any way to fix this?
doing population doc by doc:
Timeline.find(req.query).populate('recipient','username name email').populate('yell').exec(function(err,timelines){if(err){res.send(400,{error: err});}else{async.map(timelines,function(timeline,callback){timeline.yell.populate('user','username name email',function(err,yell){if(err){callback(err);}else{callback();}});},function(err,results){if(err){returnres.send(400,{error: err});}else{res.send(200,timelines);}});}});
The mongoose I'm using is version 3.6.7.
Simply speaking, the model timeline has a yell which has a user.
I followed the gist mentioned in the release note to do nested population through 'Model.populate' but got null for for inner level population (timeline.yell.user => null). If I do the inner population document by document through 'Document.populate', I can get the expected result. If there any way to fix this?
doing population doc by doc:
get the expected result:
doing nested population:
get null for yell.user
The text was updated successfully, but these errors were encountered: