[
{
"_id":"601a620fbd63390001e70609",
"member":[
{
"name":"123",
"winningGifts":[
{
"_id":"60176ca7157a0c000192a931",
"name":"牙膏",
}
]
},
{
"name":"232132",
"winningGifts":[
{
"_id":"60176c9ce2ec8e00018c06b9",
"name":"墨鱼薯片",
}
]
},
],
"activityname":"测试1",
"activityType":1,
"participateType":1,
"activityTime":"2021-02-03T08:42:17.000Z",
"giftList":[
{
"_id":"60176ca7157a0c000192a931",
"name":"XXX",
"luckDraw_number":1,
"quantity_number":1
},
{
"_id":"60176c9ce2ec8e00018c06b9",
"name":"XXXX",
"luckDraw_number":1,
"quantity_number":1
}
],
"activityStatus":2,
"desc":"",
"createTime":1612341748000,
"updateTime":1614599361000
}
]
我数据库中存储的数据是上边的格式, 我现在需要更新_id为601a620fbd63390001e70609下的giftList数组中_id为60176c9ce2ec8e00018c06b9的数据的quantity_number加1 和更新member 数组中name为123 的数据
求教我该怎么写update方法
7***@qq.com
你好,我第一次用unicloud,为什么本地云函数可以更新数据库,在线云函数不行啊,方法和你写的是一样的,是权限的问题吗?
2021-03-05 12:21
DCloud_uniCloud_WYQ
回复 7***@qq.com: 先试试上传并运行能不能行?云函数内不存在权限问题
2021-03-08 15:02