DynamoDb中的事务在put方法上返回错误

时间:2018-12-07 09:19:42

标签: php transactions amazon-dynamodb aws-sdk

我想使用dynamodb在php项目的事务中进行放置操作,因此使用aws sdk。我已经尝试过了:

$data =  [
            'id' => ['S' => $uuid->toString()],
            'post_id' => ['N' => '1'],
            'occurred_at' => ['S' => date('Y-m-d H:i:s')]
        ];


$this->client->transactWriteItems([
                'TransactItems' => [
                    [
                        'Put' => [
                            'TableName' => $this->table,
                            'Item' => $data
                        ]
                    ]
                ]
            ]
        );

它向我返回此错误:

GuzzleHttp\Exception\ClientException: Client error: `POST http://localhost:8000` resulted in a `400 Bad Request` response:
{"__type":"com.amazonaws.dynamodb.v20120810#UnknownOperationException","message":"An unknown operation was requested."}

如果我创建一个简单的putItem,它就可以正常工作。

我该如何解决?

谢谢

0 个答案:

没有答案