3 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Hi, I am reviewing this now, and will send you an update once I have more information. Thank you.
répondu il y a 5 ans
0
I tried the following:
#Existing item json:
c:\PADMA\UTILS\SCRIPTS>aws dynamodb scan --table-name example
{
"Items": [
{
"pk": {
"N": "1"
},
"example1": {
"M": {
"example2": {
"M": {
"name2": {
"S": "a"
},
"name1": {
"S": "blabla"
}
}
}
}
},
"sk": {
"S": "key"
}
}
],
"Count": 1,
"ScannedCount": 1,
"ConsumedCapacity": null
}
#Update command:
table.update_item(
Key={
'pk': pk,
'sk': sk
},
UpdateExpression="set example1.example2.name3=:x",
ExpressionAttributeValues={
':x': "new value"
},
ReturnValues="UPDATED_NEW"
)
#Updated item json:
c:\PADMA\UTILS\SCRIPTS>aws dynamodb scan --table-name example
{
"Items": [
{
"pk": {
"N": "1"
},
"example1": {
"M": {
"example2": {
"M": {
"name1": {
"S": "blabla"
},
"name2": {
"S": "a"
},
"name3": {
"S": "new value"
}
}
}
}
},
"sk": {
"S": "key"
}
}
],
"Count": 1,
"ScannedCount": 1,
"ConsumedCapacity": null
}
Is this what you are trying to do? I am getting the expected results. I followed this tutorial: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.Python.01.html
Can you try this out. And let me know if you are still having trouble with this?
répondu il y a 5 ans
0
Yes, that's work
My mistake was that one of my values had to be created in a new object, but since the object did not exist, it did not understand the path.
Thanks for your help
répondu il y a 5 ans
Contenus pertinents
- demandé il y a un an
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 7 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 4 mois