I often come across this split roadwhen modeling Firebase/Firestore, perhaps you can shed light on this.
If I have multiple admins who can each clients (100s) under their name. The admin can't see the other admin clients (consider them like separate companies). What would be better?
1) Add Clients root collection and under it add a document with ID being the admin email and under that a subcollection with clients documents:
Firestore-root
|
--- Clients(collection)
|
--- Admin ID/Email(Collection)
|
----------Clients Info (documents)
2) OR Add clients root collection with clients documents under it but an attribute in every document would be the admin email:
Firestore-root
|
--- Clients(collection)
|
--- Clients Info (documents)
|
--- AdminId: (email)
I find the first one is easier to query and most importantly more readable if you want to view the data in the console during testing/or even production. But I find the second one is less number of levels.
What is the right way to approach this? Thank you