Question: Being new to Elixir I'm having some problems understanding pattern matching.

If I have an Elixir data structure like this:

```
list_with_maps = [%{"id" => 1, "name" => "a"}, %{"id" => 2, "name" => "b"}]

```

What would be the best way to get values of all id fields from it?

Answer: 
You can map over the list and return the id using [Enum.map/2](http://elixir-lang.org/docs/v1.1/elixir/Enum.html#map/2)

```
Enum.map(list_with_maps, fn (x) -> x["id"] end)
[1, 2]

```

You can write the same function using the [capture](http://elixir-lang.org/docs/v1.1/elixir/Kernel.SpecialForms.html#&/1) operator:

```
Enum.map(list_with_maps, & &1["id"])

```

I prefer writing `& &1["id"]` as `&(&1["id"])` but the parentheses are optional.
To extract the name value from the list of maps

```
names = for %{name: n, id: _} <- list_with_maps, do: n

```