2 ms·
> The thing with the users collection is that I need to be able to add any arbitrary attribute to the user document so I can't really use a table with a schema.
by perlgeek 9y ago
> The thing with the users collection is that I need to be able to add any arbitrary attribute to the user document so I can't really use a table with a schema.
You could put the attributes that all users share (username, email address, maybe hashed password) in a table, and then have a jsonb or hstore field for the rest of the attributes. That way you can still programmatically access the elements, and even build indexes over them.
But if you have no real reason to change DB, don't.
- Kiro 9y agoThat's a good idea. Thanks.