I store user accounts in DynamoDB:
{
email: 'user1@xxx.com',
expires: 1548807053247,
}
My hash key is the email
field.
I want to add a daily cron job which will send a reminder email for all accounts about to expire (in the next 14 days).
For that, I need to query on expires
field alone - without using the hash key.
I assume I need to define a secondary index on this field (probably global and not local?), but I'm not sure on how to write the proper query for it.
I'm using AWS.DynamoDB.DocumentClient for accessing the table, thanks in advance!