我正在使用 dynamoDb 来存储一些额外的信息,但我在整理数据时遇到了一些麻烦。
我有以下创建语法,其中有 astoreId和number键。我将numberas 排序键设置为排序键,但问题是数据根本没有排序。
$response = $dynamoDb->createTable([
'TableName' => 'foo',
'KeySchema' => [
[
'AttributeName' => 'storeId',
'KeyType' => 'HASH' //Partition key
],
[
'AttributeName' => 'number',
'KeyType' => 'RANGE' // sort Key
]
],
'AttributeDefinitions' => [
[
'AttributeName' => 'storeId',
'AttributeType' => 'N'
],
[
'AttributeName' => 'number',
'AttributeType' => 'N'
]
],
'ProvisionedThroughput' => [
'ReadCapacityUnits' => 20,
'WriteCapacityUnits' => 20
]
]);
Run Code Online (Sandbox Code Playgroud)
我的扫描参数:
$scanParams = [
'TableName' => …Run Code Online (Sandbox Code Playgroud)