tywalch/electrodb

GSI using existing attribute as its SK results in query with an erroneous filter expression

PaulJNewell77 opened this issue · 3 comments

Describe the bug
If a GSI uses an existing attribute as its SK then queries are generated with an erroneous filter expression. In the playground link, see that the 'between' condition is expressed in both the KeyConditionExpression and the FilterExpression, the latter of which shouldn't be present.

ElectroDB Version
2.5.1

ElectroDB Playground Link
ElectroDB Playground

Entity/Service Definitions
See playground link

Expected behavior
Query does not include a filter expression

Errors

ElectroError: Error thrown by DynamoDB client: "Filter Expression can only contain non-primary key attributes: Primary key attribute: createdDate"

Additional context
none

Hey @PaulJNewell77

This is a near identical ticket to this one: #228

Would you mind if I closed this one to consolidate the work under one ticket? Is there parts to this one that aren't covered in that one?

Sure, hadn't read the detail on that one so didn't realise they were related in solution. They look the same so by all means close, thanks.