Mongodb Schema considering sub-document to avoid multiple reads
I am trying to come up with a MongoDB document model and would like others
opinions. I want to have a Document that represents an Employee. This
table will contain all attributes of an employee (I.e. firstName,
LastName). Now where I am stuck coming from the relational realm, is the
need to store a list of employees an employee can access. In other words
lets say Employee A is a Manager. I need to store the direct reports that
he manages, in order to use this in various applications. In relational I
would have a mapping table that tied an employee to many employees. In
mongo not being able join documents, do you think I should utilize an
embeded (sub-document) to store the list of accessible employees as part
of the Employee document? Any other ideas ?
No comments:
Post a Comment