MongoId models provide an excellent level of abstraction. Consider a User model.
We have derived an _Admin _type from it.
This avoids having to have an explicit user type. In the database the distinction will be the _type
field and correct objects are instantiated by querying auto-magically.
But how do we promote a User into an Admin?
We have to change the internal _type
field. So far I found only one way, reach down to MongoDB and update the field explicitly.
I feel dirty. Is there a better way?