【发布时间】:2018-08-10 09:26:37
【问题描述】:
我创建了一个以 User 作为基础模型的 Artist 模型。我试图通过 Loopback 资源管理器更新艺术家模型,但出现错误:
"message": "ValidationError:
Artist实例无效。详细信息:password不能为空(值:未定义);
我已经注册了一个示例信息,并且我在 MongoDB 的艺术家数据库中有它。我不知道为什么我只是想更新现有数据时需要在电子邮件和密码字段中输入一些内容?
这是我的艺术家 JSON:
{
"name": "Artist",
"base": "User",
"idInjection": false,
"options": {
"validateUpsert": true,
"strictObjectIDCoercion": true
},
"properties": {
"firstName": {
"type": "string"
},
"middleName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"telephoneNumber": {
"type": "string"
},
"country": {
"type": "string"
},
"city": {
"type": "string"
},
"genre": {
"type": "string"
},
"description": {
"type": "string"
},
"pricing": {
"type": "string"
},
"profilePicture": {
"type": "string"
}
},
"validations": [],
"acls": [
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW",
"property": "create"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$owner",
"permission": "ALLOW",
"property": [
"updateAttributes",
"deleteById"
]
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
],
"methods": {}
}
我在这里错过了什么吗?
【问题讨论】:
标签: loopbackjs loopback