Looping through a headless bundle ByParam

I just cannot figure out how to loop through a headless bundle by parameter. I have figured out that I can loop through a bundle like so:

{{ $headlessbundle := .Site.GetPage "/team" }}
{{ $resourcelist := $headlessbundle.Resources.ByType "page" }}
  {{range $resourcelist }}
    <div class="col-md">
      <img class="section-svg lärvi" src="{{ .Params.photo }}" alt="{{ .Params.name }}" />
    </div>
{{ end }}

But if I want these to be in a specific order, I just can’t get it working. I have tried stuff like

{{range $resourcelist.ByParam "rank" }} but it does not work. How can I accomplish this?