opendb-news-favorite.schema.json 878 字节
Newer Older
L
2  
linju 已提交
1 2 3 4
{
	"bsonType": "object",
	"required": ["user_id", "article_id"],
	"permission": {
芊里 已提交
5
		"read": "doc.uid == auth.uid",
L
2  
linju 已提交
6 7 8 9 10 11 12
		"create": "auth.uid != null",
		"update": false,
		"delete": "doc.uid == auth.uid"
	},
	"properties": {
		"_id": {
			"description": "ID,系统自动生成"
芊里 已提交
13
		},
L
2  
linju 已提交
14 15 16 17
		"article_id": {
			"bsonType": "string",
			"description": "文章id,参考opendb-news-articles表",
			"foreignKey": "opendb-news-articles._id"
芊里 已提交
18 19 20 21
		},
		"article_title":{
			"bsonType": "string",
			"description": "文章标题"
L
2  
linju 已提交
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
		},
		"user_id": {
			"bsonType": "string",
			"description": "收藏者id,参考uni-id-users表",
			"forceDefaultValue": {
				"$env": "uid"
			},
			"foreignKey": "uni-id-users._id"
		},
		"create_date": {
			"bsonType": "timestamp",
			"description": "收藏时间",
			"forceDefaultValue": {
				"$env": "now"
			}
		}
	}
芊里 已提交
39
}