opendb-news-favorite.schema.json 1017 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. {
  2. "bsonType": "object",
  3. "required": ["user_id", "article_id"],
  4. "permission": {
  5. "read": "doc.user_id == auth.uid",
  6. "create": "auth.uid != null",
  7. "update": "doc.user_id == auth.uid",
  8. "delete": "doc.user_id == auth.uid"
  9. },
  10. "properties": {
  11. "_id": {
  12. "description": "ID,系统自动生成"
  13. },
  14. "article_id": {
  15. "bsonType": "string",
  16. "description": "文章id,参考opendb-news-articles表",
  17. "foreignKey": "opendb-news-articles._id"
  18. },
  19. "article_title": {
  20. "bsonType": "string",
  21. "description": "文章标题"
  22. },
  23. "user_id": {
  24. "bsonType": "string",
  25. "description": "收藏者id,参考uni-id-users表",
  26. "forceDefaultValue": {
  27. "$env": "uid"
  28. },
  29. "foreignKey": "uni-id-users._id"
  30. },
  31. "create_date": {
  32. "bsonType": "timestamp",
  33. "description": "收藏时间",
  34. "forceDefaultValue": {
  35. "$env": "now"
  36. }
  37. },
  38. "update_date": {
  39. "bsonType": "timestamp",
  40. "description": "更新\/修改时间",
  41. "forceDefaultValue": {
  42. "$env": "now"
  43. }
  44. }
  45. }
  46. }