我只是在 AWS dynamoDB 中练习使用示例代码 但是,更新代码不会出现错误
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the UpdateItem operation: The document path provided in the update expression is invalid for updateRun Code Online (Sandbox Code Playgroud)
我的python代码在这里。我可以在没有“地图”属性的情况下更新数据库。
table = dynamodb.Table('Movies')
title = "The Big New Movie"
year = 2015
response = table.update_item(
Key={
"year": year,
"title": title
},
UpdateExpression="set #attrName.rating = :r, #attrName.plot=:p",
ExpressionAttributeNames = {
"#attrName" : "info"
},
ExpressionAttributeValues={
':r': decimal.Decimal(5.5),
':p': "Everything happens all at once."
},
ReturnValues="UPDATED_NEW"
)
Run Code Online (Sandbox Code Playgroud)