Consider I have the following models: Company & Employee
I would create the base CompanySchema as follows:
{
"CompanyId":Guid,
"Name":String,
"IconUrl":String,
"Employees":[{
"EmployeeId":Guid,
"Name":String,
"EmployeeIds":[]
}]
}
So Employees would be in a nested collection and they need to have direct relationships (connected) with other employees.
If for instance, employees could get upwards of 50,000 records per company. Would I be better of having 2 separate collections or 1 nested collection?
If 2 collections I could cache the company to use IconUrl on employees when they are looked up. I'd also like to do sorting on employees cross company.
It would be great if anyone who has done testing or has previous experience could share their wisdom!