A DynamoDB library to ease the use of modeling complex hierarchical relationships and implementing a Single Table Design while keeping your query code readable.
MIT License
1.02k
stars
64
forks
source link
Reverse index (sk,pk) in addition to (pk,sk) leads to error message #416
Describe the bug
I have a reverse GSI on my table, but I fail to make it usable with ElectroDB. Basically, my normal keys are called (pk, sk), but I have a reverse index using (sk, pk). ElectroDB fails with an error message (see below).
Expected behavior
The Entity constructor should run without error.
Errors
This is the error that I get (see the Playground example):
The Sort Key (sk) on Access Pattern 'followings' references the field 'sk' which is already referenced by the Access Pattern(s) 'followers' as a Partition Key. Fields mapped to Partition Keys cannot be also mapped to Sort Keys.
Describe the bug I have a reverse GSI on my table, but I fail to make it usable with ElectroDB. Basically, my normal keys are called (pk, sk), but I have a reverse index using (sk, pk). ElectroDB fails with an error message (see below).
ElectroDB Version 2.14.2
ElectroDB Playground Link This one
Entity/Service Definitions Include your entity model (or a model that sufficiently recreates your issue) to help troubleshoot.
Expected behavior The Entity constructor should run without error.
Errors
This is the error that I get (see the Playground example):
Additional context
I can't believe the error message because having a reverse index is one of the usual tricks in DynamoDB applications. See https://aws.amazon.com/tutorials/design-a-database-for-a-mobile-app-with-dynamodb/module-4/ for an example.
What am I missing here?