Skip to content

Instantly share code, notes, and snippets.

@shirou
Created September 19, 2024 01:30
Show Gist options
  • Save shirou/439de97c310176db83c9da4bb576d428 to your computer and use it in GitHub Desktop.
Save shirou/439de97c310176db83c9da4bb576d428 to your computer and use it in GitHub Desktop.
DynamoDB JSON to flat JSON (nested JSON is not supported)
cat foo.json | jq -r '.dynamodb.NewImage | with_entries(.value |= (if .S then .S elif .N then (.N|tonumber) elif .NULL then null elif .BOOL then .BOOL else . end))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment