I have survey data which needs to work in two languages and will reside in a dynamodb table. The stored objects will contain many categoricals and I would like to make the storage as efficient as possible and not in a specific language.
Given the foreign key array: ["Religious", "Atheist", "other"]
I want to decode the object {yourfriendsare:[1,3]}
to be: {yourfriendsare:["Religious", "Other"]}
It needs to encode & decode deeply nested keys/arrays. I would just give it paths (with wildcards) to the categoricals and an en/decoding array or similar.
I couldn't find what I was looking for on github/NPM (probably not using the correct terms) so before I wrote an encoder/decoder I wanted to ask here if such a lib already exists.
Bonus points if it can minimize key names too.
Any suggestions appreciated.
Ended up using jsonata. https://www.npmjs.com/package/jsonata It can filter JSON well and (using functions) transform nodes reasonably well.
It is not purpose built for what I wanted but it's close enough.