search

Home  >  Q&A  >  body text

mongodb权限设计问题

现在要做一个系统,角色有系统管理员、管理员、医生和病人。且权限依次下降。
现在设计需要用户Schema,我的问题是:这4者间共同的部分有帐号、密码和角色名。而医生和病人具有很多各自的属性,如病人的具体信息、病例、家属信息等。
现在对于mongodb这种NoSQL,该如何设计呢?是每个用户独立一份Schema,还是抽象出共同的部分,然后再进行各自的补充?

阿神阿神2770 days ago642

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-04-28 09:05:38

    You can make full use of the characteristics of MongoDB. There is no need to abstract certain commonalities. They can even be mixed together and distinguished by user type. In NoSQL design, you don’t need to pay too much attention to the concept of columns (same attributes), otherwise you will lose the advantages of NoSQL, and you will even find that query operations are more troublesome than SQL later.

    reply
    0
  • Cancelreply