-1

I try to update one item from DynamoDb CLI but I am getting error

aws dynamodb update-item \
    --table-name test \
    --key '{"testid": {"S": "testing"}}' \
    --update-expression "SET userType = :ut" \
    --expression-attribute-values  '{":ut":{"L":[{"S":"PRIMARY"},{"S":"SECONDRY"}]}}' \
    --return-values ALL_NEW
user13000875
  • 387
  • 2
  • 14

1 Answers1

0

Try replacing single quotes (') to double quotes (") and double quotes(") to backslash double quotes ("). Some terminals may not process single quotes correctly.

aws dynamodb update-item \
--table-name test \
--key "{\"testid\": {\"S\": \"testing\"}}" \
--update-expression "SET userType = :ut" \
--expression-attribute-values  "{\":ut\":{\"L\":[{\"S\":\"PRIMARY\"},{\"S\":\"SECONDRY\"}]}}" \
--return-values ALL_NEW
buddemat
  • 4,552
  • 14
  • 29
  • 49
Hee Su Chang
  • 106
  • 5