Getting a list of unique hash key values from dynamodb using boto

扶醉桌前 提交于 2019-12-10 13:05:01

问题


I want to get a list of unique hash key values for a dynamodb table. The only way that I know to do it currently is to scan the entire table and then iterate over the scan. What is the better way?


回答1:


rs = list(table.scan(range__eq="rangevalue"))
for i in rs:
    print i['primarykey']

should do the trick. I'd love to hear cheaper ways to do the same thing.



来源:https://stackoverflow.com/questions/25438715/getting-a-list-of-unique-hash-key-values-from-dynamodb-using-boto

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!