2020-07-31 18:34:27 +08:00
|
|
|
|
{
|
|
|
|
|
"schema": {
|
|
|
|
|
"bsonType": "object",
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"required": ["goods_id", "user_id", "content"],
|
2020-10-27 18:21:58 +08:00
|
|
|
|
"permission": {
|
2020-10-28 20:21:38 +08:00
|
|
|
|
"read": true,
|
|
|
|
|
"create": "auth.uid != null",
|
|
|
|
|
"update": "doc.user_id == auth.uid",
|
|
|
|
|
"delete": "doc.user_id == auth.uid"
|
2020-10-27 18:21:58 +08:00
|
|
|
|
},
|
2020-07-31 18:34:27 +08:00
|
|
|
|
"properties": {
|
|
|
|
|
"_id": {
|
|
|
|
|
"description": "存储文档 ID(文章 ID),系统自动生成"
|
|
|
|
|
},
|
|
|
|
|
"goods_id": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-10 16:11:13 +08:00
|
|
|
|
"description": "分类 id,参考`opendb-mall-goods`表",
|
|
|
|
|
"foreignKey":"opendb-mall-goods._id"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
|
|
|
|
"user_id": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-10 16:11:13 +08:00
|
|
|
|
"description": "评论者的uid,参考 uni-id-users 表",
|
|
|
|
|
"foreignKey":"uni-id-users._id"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"content": {
|
2020-07-31 18:34:27 +08:00
|
|
|
|
"bsonType": "string",
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"description": "评论内容",
|
2020-12-23 20:20:34 +08:00
|
|
|
|
"title":"评论内容",
|
|
|
|
|
"trim":"both"
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"create_date": {
|
2020-07-31 18:34:27 +08:00
|
|
|
|
"bsonType": "timestamp",
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"description": "评论发表时间",
|
|
|
|
|
"defaultValue": {
|
|
|
|
|
"$env": "now"
|
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
},
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"publish_ip": {
|
2020-07-31 18:34:27 +08:00
|
|
|
|
"bsonType": "string",
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"description": "评论发表时,客户端的 IP 地址",
|
|
|
|
|
"forceDefaultValue": {
|
|
|
|
|
"$env": "clientIP"
|
|
|
|
|
}
|
2020-07-31 18:34:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"data": [],
|
2020-10-26 19:03:12 +08:00
|
|
|
|
"index": [
|
|
|
|
|
{
|
|
|
|
|
"IndexName": "goods_id_",
|
|
|
|
|
"MgoKeySchema": {
|
|
|
|
|
"MgoIndexKeys": [
|
|
|
|
|
{
|
|
|
|
|
"Name": "goods_id",
|
|
|
|
|
"Direction": "1"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"MgoIsUnique": false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2020-07-31 18:34:27 +08:00
|
|
|
|
}
|