1 Answer
- Newest
- Most votes
- Most comments
0
【以下的回答经过翻译处理】 您可以对项目进行更新,并仅设置一个属性的值。 Client1可以设置a1=10,Client2可以设置a2=10,这没有问题。
# aws dynamodb put-item --table-name test --item '{"pk": { "S": "1" }}'
# aws dynamodb get-item --table-name test --key '{"pk": { "S": "1" }}'
{
"Item": {
"pk": {
"S": "1"
}
}
}
# aws dynamodb update-item --table-name test --key '{"pk": { "S": "1" }}' --update-expression "SET a1 = :a1" --expression-attribute-values '{":a1" : {"N":"10"}}' --return-values ALL_NEW
{
"Attributes": {
"a1": {
"N": "10"
},
"pk": {
"S": "1"
}
}
}
# aws dynamodb update-item --table-name test --key '{"pk": { "S": "1" }}' --update-expression "SET a2 = :a2" --expression-attribute-values '{":a2" : {"N":"10"}}' --return-values ALL_NEW
{
"Attributes": {
"a1": {
"N": "10"
},
"pk": {
"S": "1"
},
"a2": {
"N": "10"
}
}
}
Relevant content
- Accepted Answerasked a year ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 years ago