2020-09-08 14:37:48 +08:00
|
|
|
|
{
|
|
|
|
|
"schema": {
|
|
|
|
|
"bsonType": "object",
|
|
|
|
|
"required": ["user_id", "article_id"],
|
2020-10-27 17:13:08 +08:00
|
|
|
|
"permission": {
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"read": true,
|
|
|
|
|
"create": "auth.uid != null",
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"update": false,
|
2021-09-13 15:47:44 +08:00
|
|
|
|
"delete": "doc.user_id == auth.uid"
|
2020-10-27 17:13:08 +08:00
|
|
|
|
},
|
2020-09-08 14:37:48 +08:00
|
|
|
|
"properties": {
|
|
|
|
|
"_id": {
|
|
|
|
|
"description": "ID,系统自动生成"
|
|
|
|
|
},
|
|
|
|
|
"article_id": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-10 16:11:13 +08:00
|
|
|
|
"description": "文章id,参考opendb-news-articles表",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"foreignKey": "opendb-news-articles._id"
|
2020-09-08 14:37:48 +08:00
|
|
|
|
},
|
|
|
|
|
"user_id": {
|
|
|
|
|
"bsonType": "string",
|
2020-10-27 17:17:12 +08:00
|
|
|
|
"description": "收藏者id,参考uni-id-users表",
|
|
|
|
|
"forceDefaultValue": {
|
|
|
|
|
"$env": "uid"
|
2020-11-10 16:11:13 +08:00
|
|
|
|
},
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"foreignKey": "uni-id-users._id"
|
2020-10-26 19:08:01 +08:00
|
|
|
|
},
|
|
|
|
|
"create_date": {
|
|
|
|
|
"bsonType": "timestamp",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "收藏时间",
|
|
|
|
|
"forceDefaultValue": {
|
|
|
|
|
"$env": "now"
|
|
|
|
|
}
|
2020-09-08 14:37:48 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"index": [{
|
|
|
|
|
"IndexName": "article_user_",
|
|
|
|
|
"MgoKeySchema": {
|
|
|
|
|
"MgoIndexKeys": [{
|
|
|
|
|
"Name": "article_id",
|
|
|
|
|
"Direction": "1"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"Name": "user_id",
|
|
|
|
|
"Direction": "1"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"MgoIsUnique": true
|
2020-10-26 19:08:01 +08:00
|
|
|
|
}
|
2020-11-23 17:39:09 +08:00
|
|
|
|
}]
|
2020-09-08 14:37:48 +08:00
|
|
|
|
}
|