Created
September 19, 2024 01:30
-
-
Save shirou/439de97c310176db83c9da4bb576d428 to your computer and use it in GitHub Desktop.
DynamoDB JSON to flat JSON (nested JSON is not supported)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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