Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services Boto扫描从项目1000到2000的dynamodb表_Amazon Web Services_Amazon Dynamodb_Boto - Fatal编程技术网

Amazon web services Boto扫描从项目1000到2000的dynamodb表

Amazon web services Boto扫描从项目1000到2000的dynamodb表,amazon-web-services,amazon-dynamodb,boto,Amazon Web Services,Amazon Dynamodb,Boto,我有一张dynamodb桌子。我想建立一个页面,在那里我可以看到表中的项目。但是,由于这可能有数以万计的项目,我想看到他们在10个项目每页。我该怎么做?如何扫描项目1000到2000 import boto db = boto.connect_dynamodb() table = db.get_table('MyTable') res = table.scan(attributes_to_get=['id'], max_results=10) for i in res: print

我有一张dynamodb桌子。我想建立一个页面,在那里我可以看到表中的项目。但是,由于这可能有数以万计的项目,我想看到他们在10个项目每页。我该怎么做?如何扫描项目1000到2000

import boto

db = boto.connect_dynamodb()

table = db.get_table('MyTable')
res = table.scan(attributes_to_get=['id'], max_results=10)

for i in res:
    print i

1000~2000件是什么意思

散列键(主或索引)没有全局顺序,因此很难预先定义10000~20000项

然而,如果你想找到下一个1000个项目,考虑到最后一个退货项目,这是非常有意义的。要获取下一页,请通过提供上一页中最后一项的主键值再次执行扫描方法,以便扫描方法可以返回下一组项。参数名为
exclusive\u start\u key
,其初始值为None

详见官方文件