Filtering expired items DynamoDB TTL implementation

var epoch = Math.floor(Date.now() / 1000);
const queryTTLParams = {
TableName: table_name,

FilterExpression: "#theTTL > :ttl", //value comparison

ExpressionAttributeNames:{
"#theTTL": "expirationdate" //table column num format
},
ExpressionAttributeValues: {
":ttl": epoch //current datetime in epoch format
},
Limit: 1
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store