Closed dhubler closed 4 years ago
I assume you're using the default Gob encoding? I think the JSON encoder will be more forgiving for things like missing fields, and / or translating your values into map[string]interface{}.
I set the default as Gob so it's specifically as strict as possible, and if you want less strict handling, you can use a less strict encoder.
i am using default encoder. i see, this is really a restriction of encoder, not badgerhold. I think we can close this then, thanks for response.
First: so glad i found badgerhold, just what i was looking for after unexplained db updates silently not working in sqlite3 when using multiple go routines.
My question: Say I remove a field in a data structure and want to migrate old data. Anyone suggest a strategy? My thought was to read data into map[string]interface{} and adjust data on application restart, but attempts to serialize into map structure gave decoder errors. I'd rather not have to maintain a "legacy data structure" of every data structure and marshal into that before unmarshalling into "official data structure"