Hello各位!這個課程很棒!我有個小問題,在app.js 中
if?(id?!==?'undefined')?{????Movie.findById(id,?function(err,?movie)?{ ??????if?(err)?{ ????????console.log(err) ??????} ??????_movie?=?_.extend(movie,?movieObj) ??????_movie.save(function(err,?movie)?{
這里的save方法報錯,說cannot call method 'save' of null,說明已經進入了這個判斷分支但是_movie還沒有實例,一開始id難道不是undefined? 如何查看解決呢?
2014-10-10
把 id 和 movieObj 打印出來,cannot call method 'save' of null 說明這里拿到的示例有問題,看是不是找到這條數據