Skip to content

Instantly share code, notes, and snippets.

@hoelzro
Created May 30, 2020 00:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoelzro/85eb705f4d95209128992564e3e40d7b to your computer and use it in GitHub Desktop.
Save hoelzro/85eb705f4d95209128992564e3e40d7b to your computer and use it in GitHub Desktop.
def ddb_unpack(item):
item |
with_entries({
key: .key,
value: (.value | to_entries[0] | if .key == "NULL" then
null
elif .key == "L" then
.value | map(ddb_unpack({key:.}).key) # XXX this sucks
elif .key == "M" then
ddb_unpack(.value)
else
.value
end)
}) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment