Amazon dynamic query without primary key

I am using amazon dynamodb boto request interface for python. I have the following questions.

  • How can I get all the primary keys in the database?
  • How can I get, say 1000 primary keys. Then stop and then get the next 1000 primary keys. I do not know the primary keys in advance. This is like fetching without replacing primary keys.

It seems to me that the request uses the assumption that the user knows the primary keys in advance.

Thanks!

+7
amazon-dynamodb primary-key boto
source share
1 answer

Query requires a hash key.

In the case that you are trying to achieve, you need to evaluate each element of the table in which you need to use Scan .

It seems to me that you have 3 requirements:

  • Rate each item in a table
  • Limit each selection to 1000 elements.
  • Get only hash / range for each item

These 3 requirements are well reflected in DynamoDB:

  • Scan API:

    The Scan operation returns one or more attributes of elements and elements, referring to each element of the table or secondary index ...

  • restriction parameter :

    The maximum number of elements to evaluate (not necessarily the number of matching elements) ...

  • ProjectionExpression query parameter :

    A string that identifies one or more attributes to retrieve from the specified table or index ...

+5
source share

All Articles