调用云函数删除数据库,调用成功却并没有删除掉 是什么原因?
// 使用了 async await 语法
const cloud = require('wx-server-sdk')
cloud.init({
env: 'test-7g0nfgf97ff825fd',
} )
const db = cloud.database()
const _ = db.command
exports.main = async (event, context) => {
const ap = cloud.getWXContext()
try {
return await db.collection('shopping_cart').where({
_openid:ap.OPENID,
product_checked:"true"
}).remove()
} catch(e) {
console.error(e)
}
}