我不太明白,为什么这不起作用:
async.parallel([
SomeStuff.find({}).remove,
SomeStuff2.find({}).remove,
SomeStuff3.find({}).remove
], done);
虽然这工作正常
async.parallel([
function(callback) {
SomeStuff.find({}).remove(callback)
},
function(callback) {
SomeStuff2.find({}).remove(callback);
},
function(callback) {
SomeStuff3.find({}).remove(callback);
}
], done);
它实际上不一样吗?第一个抛出错误:
TypeError: Object #<Object> has no method 'cast'
at Query.remove (/path/to/project/node_modules/mongoose/lib/query.js:1366:10)
感谢您的帮助 :)