We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 634cffb commit 83c6abbCopy full SHA for 83c6abb
lib/dynamoid/criteria/key_fields_detector.rb
@@ -39,10 +39,13 @@ def detect_keys
39
@range_key = lsi.range_key
40
@index_name = lsi.name
41
end
42
+
43
+ return if @range_key.present?
44
45
46
# See if can use any global secondary index
- # Chooses the first GSI found that can be utilized for the query
47
+ # Chooses the last GSI found that can be utilized for the query
48
+ # GSI with range key used in query has higher priority
49
# But only do so if projects ALL attributes otherwise we won't
50
# get back full data
51
@source.global_secondary_indexes.each do |_, gsi|
0 commit comments