错误提示: “未能获取当前用户信息:30205 | 当前用户为匿名身份”
新增操作:
this.form = {
type:'work',
title:'标题',
content:'测试',
}
db.collection('note').add(this.form);
node.schema.json
{
"bsonType": "object",
"required": [],
"permission": {
"read": true,
"create": true,
"update": true,
"delete": true
},
"properties": {
"_id": {
"description": "ID,系统自动生成"
},
"type": {
"description": "类型,work:工作,live:生活"
},
"title": {
"description": "标题"
},
"content": {
"description": "内容"
},
"user_id": {
"description": "创建人",
"forceDefaultValue": {
"$env": "uid"
}
}
}
}
1 个回复
DCloud_uniCloud_WYQ
这个配置要求用户必须是登录状态