I wanted to unmarshal the dynamodb scan query response and here is my code
$client = $this->getClient();
$result = $client->scan([
'ExpressionAttributeValues' => [
':v1' => [
'S' => "200",
],
],
'FilterExpression' => 'id = :v1',
'ProjectionExpression' => "entryStamp",
'TableName' => $this->table,
]);
return $this->unmarshalItem($result['Items']);
It returns error "Unexpected type: entryStamp."
I was searching for this myself and it doesn't seem possible at the moment.
I didn't find anything specifically about PHP but this thread describe the exact same problem with GO.
So the best way to go about it is to do what Saurabh advised in his comment:
$result = $this->client->query($params);
$data = [];
foreach( $result['Items'] as $item)
{
$data[] = $marshaler->unmarshalItem($item);
}
return $data;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With