At the moment I have tasks and employees which are a many to many i.e. employees are assigned to tasks and tasks are assigned to employees.
Whenever I add/edit a task I also save which employees are assigned to that task in an array of object ids on the task row called ‘employees’ and I also add that task id to the ‘tasks’ object id array on any employees rows that have been assigned to the task. The exact opposite is done for adding/editing employees too.
However I now also have taskTypes where each task is assigned a task type i.e. a one to many - each task type has many tasks.
But I’m wondering, in this case, should I also add a ‘tasks’ object id array to my taskTypes schema and every time a task is assigned that task type its id gets pushed in the array?
I’m thinking for ease of access basically such as when I want to get a task type AND all tasks that are assigned to it. Without these ids it would require a lookup which is fine but simply using populate seems it would be easier.