Ruby code for array iteration

No,

            if [db_user_details][i][country] == "india"

isn't valid Ruby (you need to use event.get()). Why use each_index in the first place? Try this

event.get('db_user_details').each do |item|
  if item['country'] == 'india'
    event.set('flagger', 'done')
  end
end