I am a great fan of AWS step function.
One day, I had trouble querying dynamodb with boolean filter.
I found out that a slightly different syntax should be used in step function in querying with boolean filter.
This is the code that works.
{
"TableName": "addresses",
"ConsistentRead": true,
"FilterExpression":"beingUsed = :beingUsed",
"KeyConditionExpression": "#type = :EOA",
"ProjectionExpression": "#address, beingUsed",
"ExpressionAttributeNames": {
"#address": "address",
"#type": "type"
},
"ExpressionAttributeValues": {
":EOA": {
"S":"EOA"
},
":beingUsed":{
"Bool":false
}
}
}
In the ExpressionAttributeValues, it is neither
":beingUsed":false
nor
":beingUsed":{
"BOOL":false
}
It should be
":beingUsed":{
"Bool":false
}
I hope this one save someone’s time.
Thank you.