I crafted a scan query to only retrieve enabled data in the following way:
const FilterExpression = 'enabled = :enabled';
const ExpressionAttributeValues = { ':enabled': { 'BOOL': true } };
const scanParameters: ScanInput = {
TableName,
ExclusiveStartKey: cursor ?? undefined,
Limit: Number(filter.limit) ?? undefined,
FilterExpression,
ExpressionAttributeValues,
};
However, this setup does not return any values. When I modify the ExpressionAttributeValue to
const ExpressionAttributeValues = { ':enabled': true };
it does return values but does not comply with the type of ScanInput. This triggers errors similar to this https://i.sstatic.net/uHPOP.png
"Type '{ ':enabled': boolean; }' is not assignable to type 'ExpressionAttributeValueMap'. Property '':enabled'' is incompatible with the index signature. " One potential solution is to create a new type and assign values accordingly, but why isn't the ScanInput data format working as expected during data scanning?