Created
December 18, 2020 20:23
-
-
Save sergueyarellano/86896b63a0ee7e987a8f8cfbbc982d33 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getRemindersForDay (dayName, ExclusiveStartKey) { | |
const params = { | |
TableName: `${process.env.STAGE}-reminders`, | |
KeyConditionExpression: '#dayWeek = :hkey', | |
ExpressionAttributeNames: { | |
'#dayWeek': 'day' | |
}, | |
ExpressionAttributeValues: { | |
':hkey': dayName | |
}, | |
Limit: 10 // just 10 items at a time because of eventbridge limitations | |
} | |
if (ExclusiveStartKey) { | |
params.ExclusiveStartKey = ExclusiveStartKey | |
} | |
return db.query(params).promise() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment