Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static RedisAggregate ToCSRedisAggregate(this RedisAggregateType type)
        {
            switch (type)
            {
            case RedisAggregateType.Max: return(RedisAggregate.Max);

            case RedisAggregateType.Min: return(RedisAggregate.Min);

            default: return(RedisAggregate.Sum);
            }
        }
Пример #2
0
 /// <summary>
 /// 计算给定的一个或多个有序集的交集,其中给定 key 的数量必须以 numkeys 参数指定,并将该交集(结果集)储存到 destination 。
 /// 默认情况下,结果集中某个成员的分数值是所有给定集下该成员分数值之和。
 /// </summary>
 /// <param name="destination"> 新的有序集合,不含prefix前辍</param>
 /// <param name="weights">使用 WEIGHTS 选项,你可以为 每个 给定有序集 分别 指定一个乘法因子。如果没有指定 WEIGHTS 选项,乘法因子默认设置为 1 。</param>
 /// <param name="aggregateType">Sum | Min | Max</param>
 /// <param name="keys"> 一个或多个有序集合,不含prefix前辍</param>
 /// <returns>保存到目标结果集的的成员数量。 </returns>
 public long ZInterStore(string destination, decimal[] weights, RedisAggregateType aggregateType, params string[] keys) => RedisHelper.ZInterStore(destination, weights, aggregateType.ToCSRedisAggregate(), keys);