title: Filtering/Pattern Matching in nested data structure
body: <p>I am new to Elixir and still very confused with pattern matching.</p>
  
  <p><code>[%{name: "Deutschland", code: "DE"}, %{name: "Frankreich", code: "FR"}]
  </code></p>
  
  <pre><code>  def find_by_code([], _name), do: []
    def find_by_code([h | t], query) do
      if h[:code] == query do
        IO.puts("MATCH")
        IO.inspect(h)
      else
        IO.puts ("No match")
        find_by_code(t, query)
      end
    end
  </code></pre>
  
  <p>Is that the best way to find the country by code?</p>