redis中统计sorted set的score的总和的lua脚本

eval "local res = 0;local totalCards;local i =0; totalCards = redis.call('zrangebyscore','inTimeCost','-inf','+inf','withscores');for i,v in ipairs(totalCards) do if i%2 == 0 then res = res + v; end; end;return res;" 0

 

你可能感兴趣的:(redis)