Reputation: 29
I want to read all the Items of this table where postedby attribute value should equals to "Peter" partition key in this table is postid. I want to access this data using Node Js but not getting exact documentation regarding this question. Any help will be appreciated .
Upvotes: 0
Views: 230
Reputation: 7142
If you want to frequently query by a value it’s best to make that your partition key, either in the base table or in a GSI.
What good is a post ID doing as your PK? Maybe have the PK be the poster and the SK be the timestamp. Now you’ve got your data modeled in the way you’re likely to retrieve it.
Forget what you learned with relational databases. Id suggest spending an hour watching YouTube on DynamoDB schema designs.
Upvotes: 1