I have a simple mongodb app. Users create accounts when they login.
When a user creates their account I have to store the extra data somewhere.
Currently I’m extending the system.users collection in mongodb and adding a bunch of fields to it. However it is a ‘system’ collection so I’m not sure if this is a good idea.
Is this ‘bad practice’? Should I instead create a user_details collection and map it to the system.users table with the use of the ‘_id’ foreign key style?
This is definitely a bad idea.
system.userscollection is supposed to store authentication details of users that are allowed to access your database. DB users and app users are two very different entities!My suggestion: stop messing with system collections. Or else it will surely backfire in the future.