我想使用'typeId'更新数据,'type_id'不是主键。
虽然这段代码有用,但如果我们使用其他主键。
无法更新记录。
收到以下错误:
{"__type":"com.amazon.coral.validate#ValidationException","message":"The provided key element does not match the schema"}
$response = $this->dbo->updateItem([
'TableName' => $this->tableName,
'Key' => [
'typeId' => ['S' => "qtwr234"]
],
'ExpressionAttributeValues' => [
':val1' => ['N' => '1']
],
'UpdateExpression' => 'set count = :val1',
'ReturnValues' => 'ALL_NEW'
]);
答案 0 :(得分:1)
根据您收到的错误消息
如果您的密钥(哈希/主键)与您更新表中数据的参数不匹配,则会发生此错误。
解决方案:
由于