Hi,
When I update_item with Update expression as
SET #name1.#name2 = :value'
where name1 is a map
When I scan and read the item, I get the result as
'Name1.Name2':
the item is saved as #name1.#name2 instead of a map structure. Is it a known issue
Not a known issue as far as im aware, can you create a simple test case for this and i'll look into it
I have the same issue. It seems UpdateExpression doesn't work with Nested Map Attributes properly. I'm using mock_dynamodb2.
If I run something like this
table.update_item(
Key={
'ID': id,
},
UpdateExpression='SET ResultMap.#final.#key = :status',
ExpressionAttributeNames={
'#final': 'Final',
'#key': 'Key'
},
ExpressionAttributeValues={
':status': 'new status'
}
)
and then read the data with scan, a result item contains a new attribute with the key 'ResultMap.Final.Key' instead of updating a nested attribute. It works properly if I run my function in AWS.
moto version 1.1.24
Should fix it. No guarantees but it fixes @VitalyIvanov's example
@terrycain Great! Thank you! My use case now works just fine.
No problem mate. Glad its working, that bit of the code is proper evil :D