The "population" in AttributeUpdates is not correctly placed in the array. It should be the key to the element, not the element itself. "Value" and "Action" are part of an array element: The structure must be:
array(3) {
["TableName"]=>
string(7) "teacher"
["Key"]=>
array(1) {
["HashKeyElement"]=>
array(1) {
["S"]=>
string(36) "97770A6A-EF06-AF4A-3E30-87DAC0237F6D"
}
}
["AttributeUpdates"]=>
array(1) {
["population"]=>
array(1) {
["Value"]=>
array(2) {
["SS"]=>
array(1) {
[0]=>
string(36) "97770A6A-EF06-AF4A-3E30-87DAC0237F6D"
}
["Action"]=>
string(3) "ADD"
}
}
}
}
Source:
$updateOptions = array(
'TableName' => 'teacher',
'Key' => array(
'HashKeyElement' => array('S' => '97770A6A-EF06-AF4A-3E30-87DAC0237F6D'),
),
'AttributeUpdates' => array(
'population' => array('Value' => array('SS' => array('97770A6A-EF06-AF4A-3E30-87DAC0237F6D'), 'Action' => 'ADD')),
)
);
source
share