Reputation: 79
I have following structure of the DynamoDb document
{
"studentName"(PK): "Ben",
"studendId": 123,
"UpdatedTimestamp"(SortKey): 1221432432
"Subjects": [
{
SubjectName: "Math"
SubjectMarks: 80
UpdatedTimeStamp: 234324324
},
{
SubjectName: "History"
SubjectMarks: 30
UpdatedTimeStamp: 213234234
}
]
}
I am currenty using the Dynamodb Mapper to save the documents.
I have the following questions
Each time I update the table it creates a new record in DynamoDb table? Is this expected? While querying I have to set Limit to 1 each time to get the most recent record. Is it because I have the SortKey to be the current timestamp? Will it help if I remove the sortKey?
I would like to perform the following query: Get all the StudentNames who have SubjectMarks > 60 This should return the student Ben but with only the Subject Math. Is this possible? Do I need to use query or scan? Will it help to use GSI? How can I use the dot operator in this case as the Subjects is a list?
Upvotes: 1
Views: 85
Reputation: 8885
Upvotes: 0