云开发where怎么把所有记录都更新了?
update的时候明明用了where为啥还把所有的记录都更新了呢? 前几天测试还是好的。前几天不会更新所有记录,
// 云函数入口文件
const cloud = require(‘wx-server-sdk’)
cloud.init({
traceUser: true
})
// 云函数入口函数
exports.main = async(event, context) => {
try {
delete event.data_regist[’__webviewId__’]
delete event.data_regist.records_data[’__webviewId__’]
const db = cloud.database()
await db.collection(‘users_info’).where({
openid: event.data_regist.openid
}).update({
data: event.data_regist,
}).then(res => {
console.log(res)
})
} catch (e) {
console.error(e);
}
return {
}
}