-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expressions & Querying by GSI PK #7
Comments
Hello! So that's an error from DynamoDB, and I think it's probably because something's going weird between your table configuration, and what's in your Entity. Are you able to include both of those things here? |
Hi @mikebroberts - Thank you so much for your reply. Here's an example of what I'm trying to run that's resulting in the above error:
I've tried a number of different iterations of this, including explicitly including an One additional note - I'm currently not running this against a production db but am instead trying to get it to work in a test environment first. I'm using |
Can you share the code that implements the For the second argument - do you have your gsi configured in your table configuration - i.e. what you call |
Hi @mikebroberts thank you so much for your reply & absolutely - please find both included here:
Table configuration
One question on the parameters that I need to pass, generally when I'm trying to run a query on the secondary key I can just pass that secondary key (ie in cases when the secondary index primary key is not a reserved word, unlike the situation above with domain):
Is that what you're saying? |
I think this might be at least part of the problem. The GSI keys need to be on the metaAttributeNames field, not the gsiNames field (I'm sorry the config is complicated, I didn't come up with something cleaner) . E.g. look at the example in documentation here: https://github.com/symphoniacloud/dynamodb-entity-store/blob/main/documentation/GSIs.md?plain=1#L67-L85 |
I could have been clearer in the code I posted above (apologies), but I've defined my
One question. you mention the GSI keys shouldn't be on the Really thank you so much for going over this all with me, I really do appreciate it. |
Hi again, The physical GSI names should be on the The physical GSI key fields should be on So for this example for table config in the docs:
|
Hello!
I'm in the process of trying to query a particular table through using its global secondary index. I'd like to be able to query by using an expression attribute name & value, but I'm unable to determine how to configure the syntax to do so appropriately. Regardless of what I try to pass in to
queryAllWithGsiByPk
I get the following validation:ValidationException: ExpressionAttributeValues must not be empty
.I wasn't able to find anything in the documentation on how to do this (please forgive me if I just missed something) - do you happen to know of a way to accomplish what I'm trying to do?
The text was updated successfully, but these errors were encountered: