andy boot
andy boot

Reputation: 11747

mongodb - abuse of system.users collection?

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?

Upvotes: 0

Views: 260

Answers (1)

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230481

This is definitely a bad idea. system.users collection 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.

Upvotes: 1

Related Questions