Currently supported ways of schema migration are sufficient in many cases. But I think it's worth considering to have more explicit way to migrate schema for better readability / code maintenance.
It might be useful to be able to transform original MongoDb data prior to hydration. Maybe as a new lifecycle callback (e.g. preLoad). This way one could have special property for schema version in the document and normalize data according to version differencies. e.g.:
Just as example. It also simplifies writing tests for schema migrations as I think. Is it possible with current ODM internals? What do you think?
I could try to implement this feature if it is acceptable proposal.
|Field||Original Value||New Value|
|Assignee||Jonathan H. Wage [ jwage ]||Bulat Shakirzyanov [ avalanche123 ]|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Fix Version/s||1.0.0BETA1 [ 10080 ]|
|Resolution||Fixed [ 1 ]|
|Assignee||Bulat Shakirzyanov [ avalanche123 ]||Jonathan H. Wage [ jwage ]|