控制台提示:
{errMsg: "cloud.callFunction:ok", result: {…}, requestID: "d86acf1f-5d4e-11ea-88b1-5254003e0a60"}
errMsg: "cloud.callFunction:ok"
requestID: "d86acf1f-5d4e-11ea-88b1-5254003e0a60"
result:
errMsg: "collection.remove:ok"
stats:
removed: 0
__proto__: Object
__proto__: Object
批量删除云函数:
const cloud = require("wx-server-sdk")
cloud.init()
const db = cloud.database();
// 云函数入口函数
exports.main = async(event, context) => {
try {
return await db.collection('user').where({
name: 'jack'
}).remove();
} catch (e) {
console.error(e);
}
}
考虑集合权限、
控制台和云函数:
云函数日志:
errMsg: "cloud.callFunction:ok"
requestID: "cefb19e3-5dd8-11ea-b068-5254007aa7a1"
result: null