云函数更新db返回result=null,为什么?
// 云函数入口文件
const cloud = require(‘wx-server-sdk’)
cloud.init()
const db = cloud.database()//打开数据库连接
// 云函数入口函数
exports.main = async (event, context) => {
const wxContext = cloud.getWXContext()
try{
db.collection(“client”).doc(event.id).update({
data: {
userName: event.userName,
alias: event.alias,
mobile: event.mobile,
address: event.address,
createTime: db.serverDate()
}
})
} catch (e) {
console.error(‘err:’, e)
}
}