co + thunkify + mongoose 问题
我在执行这段代码时 co(function *() { var projects = yield thunkify(Project.find)({_id: {$in: ids}}); })(); 程序报错: Cannot read property ‘discriminatorMapping’ of undefined
我在查询数据时,总要自己封装一个thunk方法,感觉有点麻烦: function findProjects(para) { return function(fn){ Project.find(para, fn); } } var projects = yield findProjects({_id: {$in: ids}});
我想知道用thunkify为什么会出错?