问题
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