-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Filter by map attribute #825
Comments
As an option I would consider PartiQL (documentation). There is a limited support in Dynamoid so you can use it this way: Dynamoid.adapter.execute('SELECT * FROM users WHERE id = ?', ['1']) The only issue with PartiQL I see now is that Dynamoid does't support pagination of There is a plan to accept a keys/filter expression as a It isn't easy to simply allow referencing list elements and map attributes in As a solution I am considering allowing a user to specify placeholders on his own, e.g. this way - What do you think about it? There is a similar issue for referencing list elements (#684). |
Thanks for suggesting PartiQL. It works great for what I need to do. To continue my example, with PartiQL it would be: Dynamoid.adapter.execute("SELECT * FROM #{History.table_name} WHERE hash_column = ? AND range_column > ? AND details.status = ?", ["HashValue", range_value, "Good"]) I think allowing a filter_expression to be added directly would be good. You could allow expression_attribute_values and expression_attribute_names to be added directly as well. Manually putting in variables like Maybe create some fancy selector classes? History.where( MapSelector.new(['details','status'], 'good', operator: 'eq') ) |
Yeah, it's thought-provoking. Thank you! |
Fixed in #832 |
I just came across a need to filter a query by a map attribute value. From what I can tell there's currently no way to do this with Dynamoid.
Here's an example:
Workaround:
Here's what it could look like with the AWS SDK:
Does anyone have any other thoughts or ideas on this?
The text was updated successfully, but these errors were encountered: