I am a newbie in MongoDB and I am implementing an application for which I would like to use MongoDB.
The two basic domains of data are Person and Assignment. A person receives assignments throughout the periods of two months each. For the sake of simplicity, I am omitting business rules like how many times a person receives an assignment per period. I have to store for the assignments:
period (from month to month, e.g., 01-2021 - 02-2021), week number, week starting date, week ending date, a set of assignments for each given week in the period: a title for the assignment; the assignment type; the assignee name; the name of the assignee substitute (just in case); the assistant name; the name of the assistant substitute (just in case).
The assignee and its assistant come up from the Person document. The Person document holds the parameters to define each assignee and its assistant. So, a quite often search that will occur is searching for an available person (according to its parameters) to be an assignee or an assistant in an assignment. Moreover, there should be a rotation to prevent one person from receiving assignments much more often than others, which implies considering previous periods in such a search.
The question is, how to model both Person and Assignment domains?