mirror of
https://gitee.com/dcloud/opendb.git
synced 2024-11-10 11:09:44 +08:00
53 lines
1.2 KiB
JSON
53 lines
1.2 KiB
JSON
{
|
||
"schema": {
|
||
"bsonType": "object",
|
||
"required": ["user_id", "article_id"],
|
||
"permission": {
|
||
"read": true,
|
||
"create": "auth.uid != null",
|
||
"update": false,
|
||
"delete": "doc.uid == auth.uid"
|
||
},
|
||
"properties": {
|
||
"_id": {
|
||
"description": "ID,系统自动生成"
|
||
},
|
||
"article_id": {
|
||
"bsonType": "string",
|
||
"description": "文章id,参考opendb-news-articles表",
|
||
"foreignKey": "opendb-news-articles._id"
|
||
},
|
||
"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"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"index": [{
|
||
"IndexName": "article_user_",
|
||
"MgoKeySchema": {
|
||
"MgoIndexKeys": [{
|
||
"Name": "article_id",
|
||
"Direction": "1"
|
||
},
|
||
{
|
||
"Name": "user_id",
|
||
"Direction": "1"
|
||
}
|
||
],
|
||
"MgoIsUnique": true
|
||
}
|
||
}]
|
||
}
|