Basically, I have a table with two indexes that I'm trying to query and filter. The querying part works for the Table and the index but the problem happens when I try to filter:
ValidationException: Can not use both expression and non-expression parameters in the same request: Non-expression parameters: {QueryFilter} Expression parameters: {KeyConditionExpression}
Here are the params passed to docClient.query():
{
TableName: 'MyTable',
Limit: 15,
ScanIndexForward: false,
IndexName: 'user-date-index',
KeyConditionExpression: '#user = :yyyy',
ExpressionAttributeNames: { '#user': 'user' },
ExpressionAttributeValues: { ':yyyy': 'the_user_id' },
QueryFilter: { status: { AttributeValueList: [Array], ComparisonOperator: 'EQ' } }
}
When I call the query with the same params but without the QueryFilter, I get correct results, but I still need to filter (by status in this case, and I have about 5 other options to filter with).
I've spent a few hours trying different things and the AWS docs are not clear enough and no examples are presented, I've spent a whole day to even get to that point.