Home > Blockchain >  Is there a way to query multiple Partial Keys in dynamo DB table using AWS dashboard?
Is there a way to query multiple Partial Keys in dynamo DB table using AWS dashboard?

Time:03-31

I would like to know if there's an option to query with multiple partition keys from DynamoDB table in AWS dashboard. Unable to find any article or similar requests for dashboard on the web. Will keep you posted if I find an answer for the same.

Thanks in advance.

enter image description here

CodePudding user response:

You can only have one partition key per table; if you wish to utilize a different partition key than the one you already have then you will need to create a global secondary index.

CodePudding user response:

The Console doesn't support this directly, because there is no support in the underlying API. What you're looking for is the equivalent of the following SQL query:

select *
  from table
 where PK in ('value_1', 'value_2') /*equivalent to: PK = 'value_1' or PK = 'value_2' */

The console supports using the Query and Scan operations. Query always operates on an item collection, so all items that share the same partition key, which means it can't be used for your use case.

Scan on the other hand is a full table scan, which allows you to optionally filter the results. The filter language has no support for this kind of or logical operator so that won't really help you. It will however allow you to view all items, which includes the ones you're looking for, but as I said, it's not really possible.

  • Related