1

I am wondering if there is any way of converting the aws cli response for a dynamodb get-item request from dynamodb json format to regular json format. I am looking for a good way to version an item that is getting updated in a dynamodb table.

I have tried using some node packages (shelljs & dynamodb-converters)

tletz24
  • 33
  • 1
  • 4

1 Answers1

0
items=$(aws dynamodb scan \
  --table-name "$TABLE_NAME" \
  --query "Items")

echo "$items" | jq "map(with_entries(if .value | type == \"object\" then {key: .key, value: .value[]} else . end)) | sort_by(.${SORT_BY} | tonumber)"
Josh Woodcock
  • 2,683
  • 1
  • 22
  • 29