How to take out a value from a list of structs



Hey I have a list of structs and it has fields like: id, date, counter etc
how would i take out every id from this list and return the ids as a new list?

#2 is your friend here.


As NobbZ said, something like:, fn %{id: id} -> id end)


I ended up doing this, fn y -> y.user_event.user_id end)


You might use the short version, like this, & &1.user_event.user_id)


love it thanks