I want to store the information of user and their total_score. Each user has a facebook_id and it will be the primary key. I designed the table and index like that:
Table name: UserDataTest
Primary partition key: facebook_id (String)
Now I want to get top 50 user follow by total_ranking. I wrote the query params like that:
var params = {
TableName : "UserDataTest",
ProjectionExpression:"facebook_id, facebook_name, #lev, total_star, total_crown, total_ranking, isVip",
IndexName: "facebook_id-total_ranking-index",
ExpressionAttributeNames: {
"#lev" : "level"
}
ScanIndexForward: false,
Limit: 50
};
But i could not get the data that I need.
Can you give me a solution for this? Any idea for rewrite the query or redesign the table?
Thanks