1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
0
You can do an update item and just set the value for one attribute. Client1 can set a1=10 and client2 can set a2=10, that is no problem.
# 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"
}
}
}
respondido hace 5 años
Contenido relevante
- OFICIAL DE AWSActualizada hace 2 años
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace un año
There is no problem when attributes are different and updating at the same time and same item? what if are nested object, but different attributes?