GSI without a sort key #297
Replies: 3 comments
-
This doesn't answer your question, but provides a solution. You can use empty string.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@mathieubrd @dash-tobin Yes, It is completely valid to have GSIs without I'll pull this in as an enhancement, to be added in 1.16.x |
Beta Was this translation helpful? Give feedback.
0 replies
-
tracked as #335 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why it is not possible to have a GSI without any sort key?
For example, my use case is to retrieve all items of the same entity (e.g. retrieve all users).
So I would create my entity like so:
To retrieve all my users, I can query on my
entity
GSI withentity = User
But
Index
is typed in a way I cannot provide only a partition key.I try to put an empty string in the sort key but nothing is inserted in my GSI.
Or maybe there is another way to fullfill my use case?
Beta Was this translation helpful? Give feedback.
All reactions