UpdateAtomicItem.sh 329 B

1234567891011
  1. #!/bin/bash
  2. TABLE_NAME='elaborate_employee_table'
  3. aws dynamodb update-item \
  4. --table-name ${TABLE_NAME} \
  5. --key '{"id":{"N":"20"}}' \
  6. --update-expression "SET #ca = #ca + :val" \
  7. --expression-attribute-values '{":val": {"N":"5"}}' \
  8. --expression-attribute-names '{"#ca": "count_accessed"}' \
  9. --return-values UPDATED_NEW | jq .