Using secondary_global_index in 3.6.0 #489
Unanswered
highwaybobbery
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi, there is no any other not mentioned way to force GSI. So yes, the best option is to use current master branch and new |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, Im working on a table where I need to use a global_secondary_index in a query, because I need to search across all keys.
Here's a GIST with the model: https://gist.github.com/highwaybobbery/fef76408015a6a8681331bd698a142e4
In order to find a record by account_id (regardless of data_location), I use the global_secondary_index with:
AccountTaskRecord.find_all_by_secondary_index( {'account_id' => account_id.to_i}, scan_index_forward: false ).first
This seems to be working great (got rid of my warning and performance issue over an unindexed query, but now I have a deprecation warning
DEPRECATION WARNING: [Dynamoid] .find_all_by_secondary_index is deprecated! Call .where instead of.
Using where doesn't cut it because it doesn't use my global_secondary_index.
I see in 44ba9ed we get a .with_index method, but it is not released yet.
Question: Is there another way to use a secondary index that I am missing at the moment, or should I just wait on the next release to move over to the new method and eliminate the deprecation warning? (or am I just doing it all weird again :P)
Second Question: Any idea when the commit above will be released?
Beta Was this translation helpful? Give feedback.
All reactions