【发布时间】:2017-07-06 22:37:23
【问题描述】:
我只是想通过使用 Boto3 的查询/扫描来检索我的主键的最大值。我正在尝试完成此操作,因此我的程序可以简单地将我设置为等于最大“ID”值的变量增加 1 以用于下一个表条目。
response = table.scan(
FilterExpression=Attr('ID'). #Here is where I'd assume a condition
) #is placed to find the highest value but
#the Boto3 doc doesn't seem to have a
#method like 'max()' or something...
四处搜索我发现如何使用原始的“boto”来做到这一点,所以我确信有一种方法可以使用它的新版本“boto3”,但我还没有找到任何东西。
任何帮助/指导将不胜感激!谢谢!
Boto3 文档:http://boto3.readthedocs.io/en/latest/guide/dynamodb.html#querying-and-scanning
【问题讨论】:
标签: python python-2.7 amazon-web-services amazon-dynamodb boto3