I am performing a scan operation on my DynamoDB table then filtering the result to have items greater than a certain date in NODE.js.
The DynamoDB table formats data like this:
{
TableName: tableName,
Item: {
"visitorID": visitorIDq, // Primary Key
"dateID": dateTime, // What I am filtering the scan for, dateTime is a var I set in js
"visitorName": "END OF Q",
"employeeName": "END OF Q",
"comments": "END OF Q"
}
Current code (node):
var params2 = {
ExpressionAttributeValues: {
':msID' : {"S": '1554624723801'} // what dateID looks like in milliseconds since epoch
},
ProjectionExpression: "dateID",
FilterExpression: "dateID >= :msID", // dateID (from Table is greater than :msID which is what a value for dateID would look like in the db
TableName: "Visitor"
};
I am getting this error:
ERROR Unable to scan the table. Error JSON: {
"message": "Invalid FilterExpression: Incorrect operand type for operator or function; operator or function: > operand type: M",
"code": "ValidationException",
"time": "2019-07-06T02:00:44.569Z",
"requestId": "REQUESTID1294743204701HHH443",
"statusCode": 400,
"retryable": false,
"retryDelay": 26.7865000058784
}
After some internet searching I am kind of stuck, not really find anybody else with this issue in node. Any ideas?