SRoddis/Mongo.Migration

Suggestion : Versions as another collection

Closed this issue · 1 comments

vd3d commented

Hi,

Having a version property for each document has 3 possibles issues:

  • is expensive in term of space.
  • it prevent to have a version property for another purpose (example : car version)
  • if the application, when inserting does not also insert the current version, you can have serious migration issues

If you look, by example, at EntityFramework, they use another table, where you have something like this by example:

MyCollectionVersions:
{ "Car" : "1.0.2" }
{ "User" : "1.0.2" }
...

That way, it seems to me, it is a little bit better ;-)

Mhm, I think you do not get the point. ;-)

The migration is per document and not per collection. That allows you to run migrations on the fly.

If you have not enaugh space for a string in a document, you should not use the library. You can do your migrations manual.

And you can rename the version field.

Did you read the source code or do you just want to start a conversation? :)