I have requirement to fetch the item from dynamodb based on the order id(not the partition key).
If the order id is 123456 as mentioned the in the above example I should get this item.
Can somebody please let me know if it is possible to achieve this. If yes, how?
DynamoDB Table
@DynamoDBTable(tableName="SomeTable")
public class SomeTable {
private String id;
private String name;
private List<Order> orders;
@DynamoDBHashKey(attributeName="id")
public String getId() {
return id;
}
}
Class 2
@DynamoDBDocument
public class Order {
private String id;
private String name;
}
DynamoDB Table Data
"Items": [
{
"orders": {
"L": [
{
"M": {
"name": {
"S": "xyz"
},
"id": {
"S": "123456"
}
}
}
]
},
"id": {
"S": "789"
},
"name": {
"S": "abcd"
}
}