Person.find({})
.populate('fromCompany','name')
.exec(function (err,people) {
console.log(people)//在这里完全能输出正确而且关联到了其他表
res.render('personList', {
title: '人员信息',
people: people
})
})
td #{person.name}
td #{person.sId}
td #{person.tel}
td #{person.fromCompany.name}//这里如果写成td #{person.fromCompany.name}就不出错