我用
创建了一个表使用命令
aws dynamodb create-table
--table-name api
--attribute-definitions AttributeName=_partition_id,AttributeType=S AttributeName=_item_id,AttributeType=S
--key-schema AttributeName=_partition_id,KeyType=HASH AttributeName=_item_id,KeyType=RANGE
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 --endpoint-url http://localhost:8000
当我尝试使用以下参数更新项目时,我收到错误
TableName: 'api',
Key: { _partition_id: 'User', _item_id: 'fvmSaEmEIW' },
ReturnValues: 'ALL_NEW',
ExpressionAttributeNames:
{ '#updated_at': '_updated_at',
'#hashed_password': '_hashed_password' },
ExpressionAttributeValues:
{ ':H4GFZ': '2017-06-14T08:54:43.905Z',
':myKOH': 'xxxxx' },
UpdateExpression: 'SET #updated_at = :H4GFZ, #hashed_password = :myKOH' }
您可以看到没有遗漏任何内容,这是错误,通常会在缺少排序或分区键时触发
ValidationException: The number of conditions on the keys is invalid