麻烦明白的大佬帮忙看一下,万分感谢!
exports.main = async (event, context) => {
var dbname = ['B5','B6','B6N','B7','B8','B9'];//数据库
const _ = db.command;
for(var i = 0; i < dbname.length; i++){
try {
console.log(dbname[i]);
return await db.collection(dbname[i]).where({
_id:_.exists(true)
}).remove()
} catch (e) {
console.log(e)
}
}
}
retrun 去掉,写到for循环外面