I’ve build an inadequate solution to migrate various documents (of varying types) from one key prefix to another (we call them regions). To facilitate this, I’ve been using LegacyDocument.
The problem is that the data is getting corrupted during the transfer of binary data; in this case, it’s string data that’s been appended to, but obviously we want a very generic solution.
Our current solution uses a view to determine all matching keys, retrieve data as LegacyDocument, refactor the key for region desired, and write the document back out. For JSON documents, we merely detect if the data starts with { and ends with } and convert that to a JSON document to maximize correctness. All the others are left as LegacyDocument.
Thanks for any ideas…
-H