Currently, I have a table in DynamoDB with this schema:
ID : PostID (Hash Key)
Location : LocationID (Range Key)
Tags: List of strings
Now I want to be able to query the Tags list and for each item in the table and find which Posts have those tags. How do I do that? Reading over the DynamoDB docs, I figure that I will have to set up another table since a Query cannot search specific strings in a List/String Set but I was not able to figure out how to structure the table.
For example, item:
PostID: Guid
Location: someLocationString
Tags: ["Queen", "Royalty", "England"]
Now I want to query for items that have a tag called "Queen" and I want the result to be a set of items that has the tag. (PostID + Location)
What would be the optimal structure? And how would I maintain the table when adding new tags?