【发布时间】:2017-12-12 16:57:33
【问题描述】:
我们需要创建自定义的最后评估键
用例如下:
第一次扫描表有十条记录,当我进行第二次扫描操作时,第十条记录应该是我最后评估的键
提前致谢
【问题讨论】:
标签: python-3.x amazon-dynamodb flash-message botocore
我们需要创建自定义的最后评估键
用例如下:
第一次扫描表有十条记录,当我进行第二次扫描操作时,第十条记录应该是我最后评估的键
提前致谢
【问题讨论】:
标签: python-3.x amazon-dynamodb flash-message botocore
#Exclusive start key should be null for your first page
esk = None
#Get the first page
scan_generator = MyTable.scan(Limit=10, exclusive_start_key=esk)
#Get the key for the next page
esk = scan_generator.kwargs['exclusive_start_key'].values()
#Now get page 2
scan_generator = MyTable.scan(Limit=10, exclusive_start_key=esk)
编辑:
exclusive_start_key (list or tuple) – 从中继续先前查询的项目的主键。这将作为该查询中的 LastEvaluatedKey 提供。
例如
exclusive_start_key = ('myhashkey');
或
exclusive_start_key = ('myhashkey', 'myrangekey');
【讨论】: