class Redis::Cluster::Command

def determine_first_key_position(command)

def determine_first_key_position(command)
  case command.first.to_s.downcase
  when 'eval', 'evalsha', 'migrate', 'zinterstore', 'zunionstore' then 3
  when 'object' then 2
  when 'memory'
    command[1].to_s.casecmp('usage').zero? ? 2 : 0
  when 'scan', 'sscan', 'hscan', 'zscan'
    determine_optional_key_position(command, 'match')
  when 'xread', 'xreadgroup'
    determine_optional_key_position(command, 'streams')
  else
    dig_details(command, :first_key_position).to_i
  end
end