I have a list of maps containing different values
list =
[
%Samp1{
id: "11111",
sample_data1: "",
sample_data2: "",
other_datas: {}
},
%Samp2{
id: "22222",
sample_data1: "",
sample_data2: "",
other_datas: {}
},
%Samp3{
id: "33333",
sample_data1: "",
sample_data2: "",
other_datas: {}
},
]
How can i get all the values along with the ID i want to match, For Example:
if id == “33333” i want to traverse and get all values with it, so the expected result should be:
%Samp3{
id: "33333",
sample_data1: "",
sample_data2: "",
other_datas: {}
},
I tried Enum.map but I can only fetch single value each
list |> Enum.map(& &1.id)
Result: ["11111", "22222", "33333"]