How to Sort a List of Maps

From ElixirBlocks
Jump to: navigation, search

Basic Example


users = [
 %{name: "Bob"},
 %{name: "Zod"},
 %{name: "Maureen"}
]

Enum.sort_by(users, &(&1.name), :desc))

Reference

[1]