// 使用了 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)
}
}
你好,请问是怎么样解决的,可以分享一下吗?
赔我眼睛,瞎了。云函数返回结果给一下