json數(shù)據(jù)結(jié)構(gòu)
遍歷修改屬性
附上代碼
const usersTable = db.collection("getImages")
// 云函數(shù)入口函數(shù)
exports.main = async(event,context)=> {
?? try {
await usersTable.where({
'_id':event._id,
? ? ? ? ? 'item.imgId':event.imgId
}).update({
? ? ? ? data: {
? ? ? ? ? 'item.$.name':event.imgName
? ? ? ? ? }
})
} catch(e){
console.error(e)
? ? }
}