i have only two projections defined at the dynamo db GSI index level. but to create the expected response i need to get other columns as well from dynamo db .
Lets say there are 20 columns in my table and only two mentioned in global secondary index.How can i achieve this using GSI and loading data from master table .
Do i need to user Query Requests or another approach i think of is pull data from index and then search on primary table . This is my existing code :
public List<DynamoDBObject> getData(String gsiHashKey) {
DynamoDBObject dynamoDBObject= new DynamoDBObject();
command.setgsiHashKey(gsiHashKey);
final DynamoDBQueryExpression<DynamoDBObject> queryExpression =
new DynamoDBQueryExpression<>();
queryExpression.setIndexName("gsi_index_name");
queryExpression.setHashKeyValues(dynamoDBObject);
return mapper.query(DynamoDBObject.class,queryExpression)
}
Please suggest best way to achieve this.