How can I iterate over all the elements in a DynamoDB table using boto?

I would like to query the DynamoDB table and get all the elements and iterate over them through boto. How to structure a query or check that returns everything in a table?

+4
source share
1 answer

Preliminary support for the scan API was added to the boto layer2 for DynamoDB by Chris Moyer in commit 522e0548 (Added scanning on layer2 and Table), and in the meantime was updated by Mitch Garnat in commit adeb7151 (Cleared the scanning method on Layer2 and Table.) To hide level 1 data and include an intuitive query - the corresponding issue No. 574 is currently planned with boto 2.3 .

An example usage is implicitly enabled through tests / dynamodb / test_layer2.py :

# Try scans results = table.scan([('Tags', 'CONTAINS', 'table')]) n = 0 for item in results: n += 1 assert n == 2 
+4
source

Source: https://habr.com/ru/post/1392388/


All Articles