Mongoose has a populate function to deref object by id.
model.find(...).populate('a_ref_field')
I want to create a function to deference automatically by data in the field which specify collection and id
e.g., foo: {col:'user',id:'54c5c5c13a0b4090451f8715'}
model.find(...).hyperPopulate('foo')
It seems mongoose allow users to create plugin. Is that possible to create a plugin to achieve this?