Hello,
Please help me decided schema structure for User in mongoDB.
My situation is this, the app is going to have 5 different types of users - B2B user, B2B admin, B2B job poster, B2C free user and B2C subscriber.
Depending on what kind of a user is logged in, their access to certain features in the app will be limited.
How should I set up my User schema in mongoDB to keep track of what type of role the user is assigned?
For now I have set it up like this in my schema:
roles: {
isBusinessUser: { type: Boolean, default: false },
isBusinessAdmin: { type: Boolean, default: false },
isBusinessJobPosterOnly: { type: Boolean, default: false },
isFreeConsumerUser: { type: Boolean, default: false },
isSubscriberConsumerUser: { type: Boolean, default: false },
}
Do share your opinion about how it should be changed (if it should be)
Thank you!