fetch方法使用不了
我按照老師的寫法寫fetch
fetch:function(){
return this.find({}).exec(cb)
}
根本查不到
而改成這樣
fetch: function (cb) {
? ?this.find(function (error, result) {
? ? ? ?if (error) {
? ? ? ? ? ?console.log(error);
? ? ? ?} else {
? ? ? ? ? ?console.log(result); // result 為空
? ? ? ?}
? ? ? ?cb(result);
? ?});
}
就可以了,請問是我哪里出錯了嗎?還是怎么回事?急急急
2016-08-22
有可能是缺少 模塊導出 ?module.exports = MovieSchema;