Question about strong typed languages (e.g. java or go-lang) - Is there any idea how to implement the schema versioning pattern in these languages? usually, new document structure means new class/structure. But when marshaling the bson into an object, you have to first know the version, but it’s part of the bson data, so you don’t know it. If the change is only an addition of new fields - that easy to implement. But if the change is refactoring the document, changing field type etc. then I don’t know how to do that, beside reading the document into a map and then create the right object from it. But I don’t think it too optimise solution.
What do you think?