{ "schema": { "bsonType": "object", "required": ["notice_id"], "permission": { "read": "doc.state == 1 || auth.uid == doc.user_id", "create": "auth.uid != null", "update": false, "delete": "auth.uid == doc.user_id" }, "properties": { "_id": { "description": "ID,系统自动生成" }, "notice_id": { "description": "通知的id", "foreignKey": "opendb-notice._id" }, "text": { "bsonType": "string" }, "user_id": { "forceDefaultValue": { "$env": "uid" }, "foreignKey": "uni-id-users._id" }, "ip": { "forceDefaultValue": { "$env": "clientIP" } }, "create_time": { "forceDefaultValue": { "$env": "now" } }, "state": { "bsonType": "int", "defaultValue": 0, "permission": { "write": "'AUDITOR' in auth.role" } } } }, "index": [] }