DynamoDB - ScanIndexForward(true/false) return 相同
DynamoDB - ScanIndexForward(true/false) return the same
我使用了 ScanIndexForward: false 但没有得到预期的结果。所以,我把false改成了true,结果和false一样。
创建table并添加主键时,应为主键添加排序键。或者,如果您使用索引,索引应该有一个排序键。 ScanIndexForward 将按排序键对记录进行排序。
Query results are always sorted by the sort key value. If the data type of the sort key is Number, the results are returned in numeric order; otherwise, the results are returned in order of UTF-8 bytes. By default, the sort order is ascending. To reverse the order, set the ScanIndexForward parameter to false.
您可以在 AWS documentation
中找到更多详细信息
我使用了 ScanIndexForward: false 但没有得到预期的结果。所以,我把false改成了true,结果和false一样。
创建table并添加主键时,应为主键添加排序键。或者,如果您使用索引,索引应该有一个排序键。 ScanIndexForward 将按排序键对记录进行排序。
Query results are always sorted by the sort key value. If the data type of the sort key is Number, the results are returned in numeric order; otherwise, the results are returned in order of UTF-8 bytes. By default, the sort order is ascending. To reverse the order, set the ScanIndexForward parameter to false.
您可以在 AWS documentation
中找到更多详细信息