I am using dynamoDb via dynamoose and trying to use filtering and sorting.
I had secondary Index as Partition key (Organization id) and sort key as (First name).
I want to sort with same column as well wants to filter with same column, I am using below query for:
users.query("organization_id").eq(user_organization_id).filter('first_name').conatins(first_name).sort('ascending').using('organization_id_first_name_index').exec();
Its gives me error
Filter Expression can only contain non-primary key attributes: Primary key attribute: first_name
Expected result is flitering and sorting will run smoothly