我有我的表PlayersInfo 以下字段,我必須分配給$ newtablename
PlayerId-> HASH PlayerName-> RANGE PlayerPrice PlayerType PlayerNationality
$response = $client->updateItem(array(
"TableName" => $newtablename,
"Key" => array(
"PlayerId" => array('N' => 1),
"PlayerName" => array('S' => "Virat Kohli")
),
"AttributeUpdates" =>array("PlayerPrice"=>array("Value" => array('N'=>1000)),array("PlayerType"=>array("Value" => array('S'=>"Batsman")),array("PlayerNationality"=>array("Value" => array('S'=>"India")),
);
"ReturnValues" => \Aws\DynamoDb\Enum\ReturnValue::ALL_NEW
));
這必須工作.. 我在密鑰中使用了id和name,因爲它們分別是HASH和RANGE鍵,所以我們必須在key中指定它們。