我正在嘗試在 aws 中使用 python 更新我的磁區鍵,但我真的不知道是否可以更新它?
def modifyItem(URL_ADDRESS, updateKey, updateValue):
try:
response = table.update_item(
Key={
'URL_ADDRESS': URL_ADDRESS
},
UpdateExpression='set %s = :value' % updateKey,
ExpressionAttributeValues={
':value':updateValue
},
ReturnValues='UPDATED_NEW'
)
body = {
'Operation': 'UPDATE',
'Message': 'SUCCESS',
'UpdatedAttributes': response
}
return buildResponse(200, body)


uj5u.com熱心網友回復:
您無法更新專案的主鍵(其磁區鍵或排序鍵)。您必須插入一個新專案并洗掉舊專案。
是否可以在 amazon dynamo db 中更新哈希鍵
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/402879.html
標籤:
