Reputation: 93
I'm a newbie to DynamoDB and node.js. I have a requirement to search the dynamoDB table(say Table 1) items/column to find a matching attribute/field name(Not the value) and return the key. This could be a column or a field in the json data. Can you please help me with how to query it? thank you.
Upvotes: 1
Views: 1932
Reputation: 12929
DynamoDB is designed for LOOKUP using keys and not to run a random query on the data. It is a common misunderstanding for people who are coming from relational databases and are used to writing random queries on such data.
If you need to LOOKUP data using a key that is different from the primary key of the table, you can add a secondary index to the table. You can think of it as creating a new table with the same data (or pointers to the main table) but with a different set of keys.
Upvotes: 1