I am trying to query Dynamo for modified_time > 1 day
and jstatus = Error
Here, JobStatusIndex
is the Global Secondary Index
having, modified_time
as the Partition Key
and jstatus
as the sort key
.
dynamo.query({
TableName: "Jobs",
IndexName: "JobStatusIndex", // Global Secondry Index
KeyConditionExpression: `modified_time >= :ter and jstatus = :ste`,
ExpressionAttributeValues: {
':ter': moment().subtract(1, 'day').unix(),
':ste': "Error"
}
},(err) => console.log(err))
But I get an error that says:
ValidationException: Query key condition not supported
What could be the reason for this? I just don't get this.
I have gone through some SO questions, but it didn't solve the problem. I already have the required keys in place. What am I missing?