opendb/collection/opendb-news-articles/collection.json

175 lines
4.4 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"schema": {
"bsonType": "object",
"required": ["user_id", "title", "content"],
"permission": {
"read": "doc.uid == auth.uid && doc.article_status == 0 || doc.article_status == 1",
"create": "auth.uid != null",
"update": "doc.uid == auth.uid",
"delete": "doc.uid == auth.uid"
},
"properties": {
"_id": {
"description": "存储文档 ID用户 ID系统自动生成"
},
"user_id": {
"bsonType": "string",
"description": "文章作者ID 参考`uni-id-users` 表",
"foreignKey": "uni-id-users._id",
"defaultValue": {
"$env": "uid"
}
},
"category_id": {
"bsonType": "string",
"title": "分类",
"description": "分类 id参考`uni-news-categories`表",
"foreignKey": "opendb-news-categories._id",
"enum": {
"collection": "opendb-news-categories",
"field": "name as text, _id as value"
}
},
"title": {
"bsonType": "string",
"title": "",
"description": "",
"label": "",
"trim":"both"
},
"content": {
"bsonType": "string",
"title": "",
"description": "",
"label": "",
"trim":"right"
},
"excerpt": {
"bsonType": "string",
"title": "",
"description": "",
"label": "",
"trim":"both"
},
"article_status": {
"bsonType": "int",
"title": "",
"description": "0 稿 1 ",
"defaultValue": 0,
"enum": [
{
"value": 0,
"text": "稿"
},
{
"value": 1,
"text": ""
}
]
},
"view_count": {
"bsonType": "int",
"title": "",
"description": "",
"permission": {
"write": false
}
},
"like_count": {
"bsonType": "int",
"description": "",
"permission": {
"write": false
}
},
"is_sticky": {
"bsonType": "bool",
"title": "",
"description": "",
"permission": {
"write": false
}
},
"is_essence": {
"bsonType": "bool",
"title": "",
"description": "",
"permission": {
"write": false
}
},
"comment_status": {
"bsonType": "int",
"title": "",
"description": "0 1 ",
"enum": [
{
"value": 0,
"text": ""
},
{
"value": 1,
"text": ""
}
]
},
"comment_count": {
"bsonType": "int",
"description": "",
"permission": {
"write": false
}
},
"last_comment_user_id": {
"bsonType": "string",
"description": " id`uni-id-users` ",
"foreignKey": "uni-id-users._id"
},
"avatar": {
"bsonType": "string",
"title": "",
"description": "",
"label": "",
"trim":"both"
},
"publish_date": {
"bsonType": "timestamp",
"title": "",
"description": "",
"defaultValue": {
"$env": "now"
}
},
"publish_ip": {
"bsonType": "string",
"title": "IP",
"description": " IP ",
"forceDefaultValue": {
"$env": "clientIP"
}
},
"last_modify_date": {
"bsonType": "timestamp",
"title": "",
"description": "",
"defaultValue": {
"$env": "now"
}
},
"last_modify_ip": {
"bsonType": "string",
"description": " IP ",
"forceDefaultValue": {
"$env": "clientIP"
}
},
"mode": {
"bsonType": "number",
"title": "",
"description": ","
}
}
},
"index": []
}