opendb-contacts.schema.json 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. "bsonType": "object",
  3. "permission": {
  4. "read": true,
  5. "create": true,
  6. "update": true,
  7. "delete": true
  8. },
  9. "required": ["username", "mobile"],
  10. "properties": {
  11. "_id": {
  12. "description": "存储文档 ID(用户 ID),系统自动生成"
  13. },
  14. "username": {
  15. "bsonType": "string",
  16. "title": "姓名",
  17. "description": "姓名",
  18. "order": 1,
  19. "trim": "both"
  20. },
  21. "gender": {
  22. "bsonType": "int",
  23. "title": "性别",
  24. "description": "用户性别:0 未知 1 男性 2 女性",
  25. "order": 2,
  26. "defaultValue": 0,
  27. "enum": [{
  28. "text": "未知",
  29. "value": 0
  30. },
  31. {
  32. "text": "男",
  33. "value": 1
  34. },
  35. {
  36. "text": "女",
  37. "value": 2
  38. }
  39. ]
  40. },
  41. "mobile": {
  42. "bsonType": "string",
  43. "title": "电话",
  44. "order": 3,
  45. "description": "电话",
  46. "pattern": "^\\+?[0-9-]{3,20}$",
  47. "trim": "both"
  48. },
  49. "email": {
  50. "bsonType": "string",
  51. "format": "email",
  52. "title": "邮箱",
  53. "order": 4,
  54. "description": "邮箱地址",
  55. "trim": "both"
  56. },
  57. "comment": {
  58. "bsonType": "string",
  59. "title": "备注",
  60. "order": 5,
  61. "description": "备注",
  62. "trim": "both",
  63. "component": {
  64. "name": "textarea"
  65. }
  66. },
  67. "create_date": {
  68. "bsonType": "timestamp",
  69. "description": "创建时间",
  70. "forceDefaultValue": {
  71. "$env": "now"
  72. }
  73. }
  74. },
  75. "version": "0.0.1"
  76. }