jeudi 5 juin 2014

Dynamodb PHP update item


Vote count:

0




I have been debugging some code I have written but it seems between the aws documentation and everywhere I look I can not seem to find the proper method of updating items that already exist within a table. I keep getting errors that my commands are wrong


I have been at this for a few hours, so I decided to stop wasting my time and ask ahah.


I have 2 items I need to update:



The first item I need to increment by 1

and the second Item I need to update with a new string.


last thing I tried:



$response = $client->updateItem(array(
"TableName" => self::KEY_LOGIN_TABLE,
"Key" => array(
"Id" => array(Type::STRING => $response[self::KEY_UUID])),
"AttributeUpdates" => array(
"NewAttribute" => array(
self::KEY_LOGIN_ATTEMPTS => array(Type::NUMBER => $response[self::KEY_LOGIN_ATTEMPTS]+1),
self::KEY_LAST_LOGIN_ATTEMPT => array(Type::STRING => $timestamp)))
));


If anyone could give help me out with a sample code in PHP that works I would be very grateful!



asked 22 secs ago






Aucun commentaire:

Enregistrer un commentaire