How do I loop over all items in a DynamoDB table using boto?

喜你入骨 提交于 2019-12-05 14:53:20

Preliminary support for the Scan API had been added to boto's layer2 for DynamoDB by Chris Moyer in commit 522e0548 (Added scan to layer2 and Table) and has meanwhile been updated by Mitch Garnaat in commit adeb7151 (Cleaned up the scan method on Layer2 and Table.) to hide the layer1 details and enable intuitive querying - the respective issue #574 is currently scheduled to be released with boto 2.3.

A usage sample is implicitly included via tests/dynamodb/test_layer2.py:

# Try scans
results = table.scan([('Tags', 'CONTAINS', 'table')])
n = 0
for item in results:
    n += 1
assert n == 2
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!