I have 2 problems. I want to query a dynamodb database on Bool and on Date.
Is this possible as I only see String Number and Binary?
There are two types of expressions.
KeyConditionExpression - Supports only String, Number and Binary
FilterExpression - Can be used for Non-Key attributes. You can query for the Date and BOOL attributes.
There is a BETWEEN operator which can be used for DATE range as well.
Code to filter by Date:-
var params = {
TableName : table,
KeyConditionExpression : 'email = :email',
FilterExpression: 'createdAt = :createdAt',
ExpressionAttributeValues : {
':email' : '[email protected]',
':createdAt' : "2016-11-07"
}
};
My Item:-
Date is stored as String in database.
Date S (string type). The Date values are stored as ISO-8601 formatted strings.