I am working on a system where mongodb has been chosen as the backend db. The system stores adverts for cars. There are the following collections so far:- cars - list of adverts posted by users userprofile - list of users in the system containing names,address,phone no etc.
Now the issue I have here is that the users can be of different types e.g, private user, dealer user, admin user etc.enter code here
My thinking is that the userprofile collection can embed details of dealers where required and leave them empty when not in use so as an example:-
public class userprofile
{
public string Username{get;set;}
public string UserFirstname{get;set;}
....
public UserType UserType{get;set;}
public Company Company{get;set;}
}
Using this model would it be ok to decide who the user is by checking the UserType, i.e UserType == UserType.Dealer then I can look into the Company object otherwise ignore it.
Or would it be best to do this some other way.
Any suggestions appreciated.
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
--