You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have an error I'm getting which I don't quite understand. I have the following dynamoDB with a GSI and a primary index. I try to represent this in electrodb with the following setup:
I get the following error though:
Runtime.UnhandledPromiseRejection: ElectroError: The Sort Key (sk) on Access Pattern 'listingToAssets' references the field 'listingId' which is already referenced by the Access Pattern(s) 'asset' as a Partition Key. Fields mapped to Partition Keys cannot be also mapped to Sort Keys. - For more detail on this error reference: https://github.com/tywalch/electrodb#inconsistent-index-definition
Entity/Service Definitions
Include your entity model (or a model that sufficiently recreates your issue) to help troubleshoot.
Expected behavior
No validation error. GSI shouldn't have validations for what's in the primary index.
Errors
Runtime.UnhandledPromiseRejection: ElectroError: The Sort Key (sk) on Access Pattern 'listingToAssets' references the field 'listingId' which is already referenced by the Access Pattern(s) 'asset' as a Partition Key. Fields mapped to Partition Keys cannot be also mapped to Sort Keys. - For more detail on this error reference: https://github.com/tywalch/electrodb#inconsistent-index-definition
The Sort Key (sk) on Access Pattern 'inverted' references the field 'sortKey' which is already referenced by the Access Pattern(s) 'table' as a Partition Key. Fields mapped to Partition Keys cannot be also mapped to Sort Keys.
I really needed this error not to be thrown to be able to use ElectroDB, because all DynamoDB tables we have in our company follows that inverted-key pattern.
Describe the bug
I have an error I'm getting which I don't quite understand. I have the following dynamoDB with a GSI and a primary index. I try to represent this in electrodb with the following setup:
I get the following error though:
Runtime.UnhandledPromiseRejection: ElectroError: The Sort Key (sk) on Access Pattern 'listingToAssets' references the field 'listingId' which is already referenced by the Access Pattern(s) 'asset' as a Partition Key. Fields mapped to Partition Keys cannot be also mapped to Sort Keys. - For more detail on this error reference: https://github.com/tywalch/electrodb#inconsistent-index-definition
Entity/Service Definitions
Include your entity model (or a model that sufficiently recreates your issue) to help troubleshoot.
Expected behavior
No validation error. GSI shouldn't have validations for what's in the primary index.
Errors
Additional context
Discord discussion link:
https://discord.com/channels/983865673656705025/994984119224246303/1041444793349329078
The text was updated successfully, but these errors were encountered: