I started trying something like that to read the table values but even that doesn't work.
I need to filter by device id and exclude values that are greater than 30 days. If you could give me a tip on how to filter values by attribute name, that would be great.
You need to Query, not Scan. Modify the below to your needs:
const response = await documentClient
.query({
TableName: "<YourTableName>",
ExpressionAttributeNames: {
"#pk": "<deviceId>",
"#yr": "<date attribute name>"
},
ExpressionAttributeValues: {
":pk": "<your device id>",
":yr": "<date value>"
},
FilterExpression: "#yr = :yr",
KeyConditionExpression: "#pk = :pk",
})
.promise();