How can I filter a user by email ID and retrieve the most recent entry for that user from my Dynamo database? The subscriptionID serves as the partition Key, and I do not have a secondary index or sort key set up. Is there a way to achieve this, or should I consider a different approach?
Here is my current Dynamo Query:
var docClient = new AWS.DynamoDB.DocumentClient({ region: AWS.config.region });
var params = {
TableName: 'License',
FilterExpression: "customerEmail = :email",
ExpressionAttributeValues: {
':email': email
},
};
docClient.scan(params, function(err, data) {
if (err)
{
console.log(err);
}
else
{
console.log('length ',data.Items.length);
console.log(data.Items);
}
});
https://i.sstatic.net/wqxqi.png https://i.sstatic.net/g2Hbz.png