Skip to content

Instantly share code, notes, and snippets.

@sergueyarellano
Created December 18, 2020 20:23
Show Gist options
  • Save sergueyarellano/86896b63a0ee7e987a8f8cfbbc982d33 to your computer and use it in GitHub Desktop.
Save sergueyarellano/86896b63a0ee7e987a8f8cfbbc982d33 to your computer and use it in GitHub Desktop.
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