Advices on Collection creation -> Multi type of users


#1

Hi everybody,

I’m learning Meteor and by the way MongoDB. I would like some advices about creation of collections.
I will have two different type of users in my application, it’s different kind of users, one ask for benefits from the other type of user. When a user type one is logged, he can search for something in geolocation, and a list of users two appears…

I’m wondering if it will be more scalable and better to use two collections or a unique role based collection ?

Thanks in advance for the advices! :smile:


#2

I ran into the same problem, and I found it easier to use a role-based collection. It also depends: are you using groups? Because it tends to be a little bit annoying to find someone in a role regardless of group.


#3

@guillaumekolly is it possible for a user in your app to have both roles?


#4

Thanks for the answers!

yeah, it’s like user1 is client and should be able to take appointment with an user2. But User2 is not able to take appointment with user1. But user2 has the same parameters has users1 because he has to be able to take appointment with an user2 too …
Also, there is a third user who can manage a group of user2, but user1 can’t be in a group …

an exemple could be a customer (user1) and a service provider (user2). user1 can take an appointment with any user2, not the opposite, but maybe user2 need a service so take an appointment with user1… And a company could manage a group of service provider …

Maybe more clear with an example :smiley: