This cannot work, there are no :key in pairs, and pairs contains more than one item… You need to know the shape of your data to pattern match correctly.
You can pattern match a lot of data as @kokolegorille said. But your initial coding attempt made zero sense: there is no key or value map keys in any of the elements in the list you showed. Why did you even try that? How would that work?
I feel by your recent posts that you have misconceptions about various Elixir workings. Have you went through the full intro course on the official website?
That sounds a bit harsh. This might be very obvious to many people here but I also remember being a bit confused over pattern matching at first. Especially when I had to jump from the intro examples to my real world data.
I usually avoid being controversial and this time kind of did it on purpose. The coding sample in the OP seemed very random and smelled like “please do my homework”.
I also based my reply on the author’s history. To me it seems he didn’t cover Elixir’s official tutorial which should be the respectful thing to do in regard to everybody else’s willingness to help.
So yes, I realise what I said was a bit controversial and I am simply explaining my reasons to do so. I am not looking to argue about it however, and won’t make further comments regarding OP, including in their future posts.