I am writing a algo for deducing the user with the least amount of work load. Based on the type/complexity of the tasks being created, i narrow down on the list of the users that are capable of performing it. Now, I need to find the user who has the least number tasks currently assigned to him/her. I am using redis sorted set to store the members/users along the score indicating the number of the tasks assigned to them. Is there a way to get a member with least score given a subset of members?
Member with minimum score:
ZRANGEBYSCORE myset -inf +inf WITHSCORES LIMIT 0 1
Member with maximum score:
ZREVRANGEBYSCORE myset +inf -inf WITHSCORES LIMIT 0 1