我需要使用boto3更新我的dynamodb表中的时间戳属性,但属性名“timestamp”是一个保留字,所以在SET命令上会抛出错误。
table.update_item(
Key={
'id': item_id
},
UpdateExpression='SET timestamp = :val1', # this is the line giving the problem
ExpressionAttributeValues={
":val1": new_timestamp
}
)
"errorMessage": "在调用 UpdateItem 操作时发生错误 (ValidationException): 无效的 UpdateExpression: 属性名称是保留关键字; 保留关键字:timestamp",