云开发 数据更新

发布于 7 年前作者 kliang11207 次浏览最后编辑 7 年前来自 ask

怎么搞都没有效果   难受

// 更新用户数据
         db.collection('user').where({ openid: e, index: true }).update({
           // data 传入需要局部更新的数据
           data: {
             // 表示将 done 字段置为 true
             age: 20
           },
           success(res) {
             console.log(res.data)
           }
         })

1 回复
xiulanyu
xiulanyu1 楼5 年前

collection的update和where使用,只能在服务器端云函数中调用,不能在小程序端调用