Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 455
Vishal Avatar asked Aug 22 '14 02:08

Vishal


1 Answers

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.

like image 194
Vishal Avatar answered Oct 18 '22 00:10

Vishal