API ReferenceSorted Sets
ZCount
Count members in a sorted set within a score range
Syntax
Redix.ZCount(key, min, max, callback)Parameters
Prop
Type
Returns
Prop
Type
Examples
-- Count players with 100-200 kills
Redix.ZCount('leaderboard:kills', 100, 200, function(err, count)
if not err then
print('Players with 100-200 kills:', count)
end
end)
-- Count all players above 500 kills
Redix.ZCount('leaderboard:kills', 500, '+inf', function(err, count)
print('Elite players:', count)
end)