strapi模型配置的private声明

private声明可以指定模型的某个属性为私有属性,不会被返回服务器返回。而且这个声明在其他模型进行population的时候仍然有效。例如

{
"connection": "default",
"collectionName": "name",
"info": {
"name": "myName"
},
"options": {
"increments": true,
"timestamps": true
},
"attributes": {
"atr1": {
"collection": "aCollection",
"via": "related",
"plugin": "upload",
"required": false,
"autoPopulate": false,
"private": true
}
}
}

做如上方式的声明时,能避免直接的population,也能避免任何方式的返回atr1

发表评论

邮箱地址不会被公开。 必填项已用*标注