1
votes

I want to do a scan on a table on dynamodb using boto, my problem is I want to paginate using the max_results and exclusive_start_key
Actually it looks like the only way to access the LastEvaluatedKey to pass it as exclusive_start_key is to manually keep track of primary keys and pass the last one as exclusive_start_key

But that is not my problem, my problem is I don't know what format (what object type) I should pass to exclusive_start_key it does not accept an int even when the table has an integer hash_key?

1

1 Answers

2
votes

According to the documentation, Layer2 implementation of Scan expects either a list or a Tuple as a representation of the Primary Key.

  • (hash_key,) for a single key table
  • (hash_key, range_key) for a composed key table

Please note that there also is a (tricky) way to directly read the esk from the Scan generator in Boto.