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

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -