我想查询 DynamoDB 表并检索所有项目并使用 boto 循环它们。如何构建返回表中所有内容的查询或扫描?
初步支持Scan API http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_Scan.html已由 Chris Moyer 添加到 DynamoDB 的 boto 第 2 层提交 522e0548 https://github.com/boto/boto/commit/522e054866899d6acf8b08d5ae8ff3e447e81c6e (添加了对 Layer2 和 Table 的扫描),同时由 Mitch Garnaat 更新为提交 adeb7151 https://github.com/boto/boto/commit/adeb715194a9d0e78d0e5f41638782c68c0071f8 (清理了 Layer2 和 Table 上的扫描方法。)隐藏第 1 层详细信息并启用直观查询 - 相应的问题 #574 https://github.com/boto/boto/issues/574目前计划发布.
通过隐式包含使用示例测试/dynamodb/test_layer2.py https://github.com/boto/boto/commit/adeb715194a9d0e78d0e5f41638782c68c0071f8#diff-2:
# Try scans
results = table.scan([('Tags', 'CONTAINS', 'table')])
n = 0
for item in results:
n += 1
assert n == 2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)