Say I have collections/documents like below:
question collection:
{
_id: ObjectId(\"0000\"),
title: \"test question\",
survey: ObjectId(\"1234\"
You need to do it in two steps; first populating survey
, and then populating survey.user
using a separate call to Model.populate:
questions.findOne({_id: '0000'})
.populate('survey')
.exec(function(err, question) {
questions.populate(
question,
{ path: 'survey.user', model: 'User'},
function(err, question) {...});
});