title: Sort List of Maps based on a value within the Map
body: <p>I have this list:</p>
  
  <pre><code>  [%Statcasters.PredictionScore{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "prediction_scores"&gt;,
    id: 1, inserted_at: ~N[2018-01-15 20:24:33.838946],
    league: #Ecto.Association.NotLoaded&lt;association :league is not loaded&gt;,
    league_id: 1, points: 4,
    prediction: #Ecto.Association.NotLoaded&lt;association :prediction is not loaded&gt;,
    prediction_id: 1,
    question: #Ecto.Association.NotLoaded&lt;association :question is not loaded&gt;,
    question_id: 1, updated_at: ~N[2018-01-15 20:24:33.838952]},
   %Statcasters.PredictionScore{__meta__: #Ecto.Schema.Metadata&lt;:loaded, "prediction_scores"&gt;,
    id: 2, inserted_at: ~N[2018-01-15 20:24:33.842205],
    league: #Ecto.Association.NotLoaded&lt;association :league is not loaded&gt;,
    league_id: 1, points: 3,
    prediction: #Ecto.Association.NotLoaded&lt;association :prediction is not loaded&gt;,
    prediction_id: 2,
    question: #Ecto.Association.NotLoaded&lt;association :question is not loaded&gt;,
    question_id: 1, updated_at: ~N[2018-01-15 20:24:33.842210]}]
  </code></pre>
  
  <p>As you can see each map has a points key. I want to sort the maps within the list and return the lowest point integer map to be the first element of the list.</p>
  
  <p>Current attempt:</p>
  
  <pre><code>Enum.map(points, fn(p) -&gt; p.points end) |&gt; Enum.sort
  </code></pre>
  
  <p>This doesn't work because it returns only the points sorted. I need the entire map.</p>