I have a users table that was create with the GUI and given a partion key of email and it is a string. I then used aws lambda to do a putItem that had:
email (string) test@testing.com
deleted (BOOL) false
This worked fine. I then tried to query it with lambda using the following params and query:
var params =
{
TableName : 'Users',
KeyConditionExpression : 'email = :email',
FilterExpression : 'deleted = :deleted',
ExpressionAttributeValues :
{
':email' : email,
':deleted':
{
BOOL: false
}
}
};
docClient.query(params, function(err, data)
{
if (err) return fn(err);
else
{
console.log("GetItem succeeded:", JSON.stringify(data, null, 2));
}
});
This always returns 0 items when I search for email = test@testing.com and leave the deleted as false. If I remove the filter expression of deleted I get an item return so why doesn't the BOOL = false work or should I use something else?