分别是数据库 admin和 校验规则
已经根据官方文档本地运行了如下代码
exports.main = async function() {
const db = uniCloud.database()
const userCollection = db.collection('uni-id-users')
const res = await userCollection.where({
dcloud_appid: db.command.exists(false) // 更新所有不存在dcloud_appid字段的用户
}).update({
dcloud_appid: ['你项目内manifest.json里面的DCloud Appid,__UNI_xxxx形式'] // 注意这里是个数组,务必正确填写
})
return res
}
效果是已经为所有账号都添加了DCloud Appid字段
目前问题是新增用户和修改用户提交时 依旧显示提交的字段["dcloud_appid"]在数据库中并不存在