database design - Should I have different collections for different users in mongodb? -
im new databases , mongo. i'm creating web app has different types of users have access different routes via different ui's. eg: user, company, admin. question should create single collection houses users , simple add "user-type" or "access-level" property on each user object? or should have 3 different collections, 1 each type of user?
what common practice type of thing?
what fields each type of user? if same, use user type option. same user can in multiple roles tomorrow. storing in same collection better.
if fields stored different, , there not chance same user can in 2 roles ever in application, use 3 collections.
Comments
Post a Comment