Order by related entries count I have a channel with a related users field. I want to output all channel entries ordered by the number of related users, this is what i have so far:

{%
    set entries = craft.entries.find({
        section:  'MyChannel',
        orderBy:  'relatedUsers'
    })
%}


What do i do to order by the number of related users?
Any native solution is likely to be slow - I would recommend using the Preparse field plugin.

It lets you use Twig to dynamically generate a field at the time an entry is saved — you could have Preparse count up the number of related users on save, and then sort by that custom field.