Cannot read property 'length' of null
exports.detail = function(req,res){
var id = req.params.id;
Movie.findById(id,function(err,movie){
Comment
.find({movie: id})
.populate('from', 'name')
.exec(function(err, comments){
console.log(comments); //这里输出 null,这是什么原因
res.render('detail',{
title: movie.title,
movie: movie,
comments: comments
})
})
})
}