// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema { "bsonType": "object", "required": [], "permission": { "read": "doc.state || auth.uid == doc.user_id || 'AUDITOR' in auth.role", "create": "auth.uid != null", "update": true, "delete": "auth.uid == doc.user_id" }, "properties": { "_id": { "description": "ID,系统自动生成" }, "text": { "bsonType": "string", "permission":{ "update":"'AUDITOR' in auth.role" } }, "user_id": { "forceDefaultValue": { "$env": "uid" }, "foreignKey": "uni-id-users._id" }, "ip": { "forceDefaultValue": { "$env": "clientIP" } }, "create_time": { "forceDefaultValue": { "$env": "now" } }, "state": { "bsonType": "bool", "forceDefaultValue":false, "permission":{ "write":"'AUDITOR' in auth.role" } } } }