Пример #1
0
        public static RedisInt ZRemRangeByScore(string key, double min, double max, bool exclusiveMin = false, bool exclusiveMax = false)
        {
            string min_score = RedisArgs.GetScore(min, exclusiveMin);
            string max_score = RedisArgs.GetScore(max, exclusiveMax);

            return(new RedisInt("ZREMRANGEBYSCORE", key, min_score, max_score));
        }
Пример #2
0
        public static RedisInt ZCount(string key, double min, double max, bool exclusiveMin = false, bool exclusiveMax = false)
        {
            string min_score = RedisArgs.GetScore(min, exclusiveMin);
            string max_score = RedisArgs.GetScore(max, exclusiveMax);

            return(new RedisInt("ZCOUNT", key, min_score, max_score));
        }
Пример #3
0
        public static RedisStrings ZRevRangeByScore(string key, double max, double min, bool withScores = false, bool exclusiveMax = false, bool exclusiveMin = false, long?offset = null, long?count = null)
        {
            string min_score = RedisArgs.GetScore(min, exclusiveMin);
            string max_score = RedisArgs.GetScore(max, exclusiveMax);

            string[] args = new[] { key, max_score, min_score };
            if (withScores)
            {
                args = RedisArgs.Concat(args, new[] { "WITHSCORES" });
            }
            if (offset.HasValue && count.HasValue)
            {
                args = RedisArgs.Concat(args, new[] { "LIMIT", offset.Value.ToString(), count.Value.ToString() });
            }

            return(new RedisStrings("ZREVRANGEBYSCORE", args));
        }