I am using amazon dynamodb, lambda and api gateway services. I have a table in dynamodb call photo-group and it's Primary key is pid and other data such ownerid, photosrc,photosize etc.
I know how to use scan to get the data like:
var data = JSON.stringify({
"operation":'list',
"TableName":"photo-group",
"FilterExpression": "ownerid = :val)",
"ExpressionAttributeValues": {":val": user}
});
But now I try to limit the result to get only 30 items by adding "Limit:30". I found that scan will scan the first 30 rows for me and not return 30 items to me. May I know how to filter 30 items by ownerid?
Thank you so much!