云函数
const db=cloud.database();
// 云函数入口函数
exports.main = async (event, context) => {
try{
return await db.collection(‘user’).where({
name: “wangjuan”
}).remove();
}catch(e){
console.log(e)
}
}
调用云函数
wx.cloud.callFunction({
name:“batchDelete”
}).then(res => {
console.log(res);
}).catch(err => {
console.log(err)
})