Does anyone know if Mongoid has built in support to alias field names? I’ve been running some tests where I have a collection with a minimal amount of fields (7 fields). If I use descriptive names and load real data and then use greatly shortened names and load the same real world data I see a 40% reduction in the total size of my collection. In looking at other drivers for MongoDB (non Ruby) I see that some of them have built in support where you can write code against a descriptive name but the persistence is smart enough to use developer defined aliases. I’m just trying to determine if Mongoid has anything similar.
Share
Actually, the following must also be included for passing a hash to new or update_attributes:
This allows your alias to be mapped to the field on the create or update calls. It would be trivial to then track alias to field mappings in order to abstract this process.