Skip to content

Commit 4092810

Browse files
committed
simplified the answer to the exercise
there's no need for --expression-attribute-names. I also added return-values to demonstrate that the command behaves as expected.
1 parent 7c4d1d6 commit 4092810

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/hands-on-labs/explore-cli/cli-writing-data.en.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ aws dynamodb update-item \
132132
--key '{
133133
"Id" : {"N": "201"}
134134
}' \
135-
--update-expression "SET #Color = list_append(#Color, :values)" \
136-
--expression-attribute-names '{"#Color": "Color"}' \
135+
--update-expression "SET #Color = list_append(Color, :values)" \
137136
--expression-attribute-values '{
138137
":values" : {"L": [{"S" : "Blue"}, {"S" : "Yellow"}]}
139138
}' \
139+
--return-values ALL_NEW \
140140
--return-consumed-capacity TOTAL
141141
```
142142

@@ -148,8 +148,8 @@ aws dynamodb update-item \
148148
--key '{
149149
"Id" : {"N": "201"}
150150
}' \
151-
--update-expression "REMOVE #Color[2], #Color[3]" \
152-
--expression-attribute-names '{"#Color": "Color"}' \
151+
--update-expression "REMOVE Color[2], Color[3]" \
152+
--return-values ALL_NEW \
153153
--return-consumed-capacity TOTAL
154154
```
155155

0 commit comments

Comments
 (0)