Example usage for org.springframework.data.redis.connection RedisConnection zRemRangeByScore

List of usage examples for org.springframework.data.redis.connection RedisConnection zRemRangeByScore

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection zRemRangeByScore.

Prototype

@Nullable
Long zRemRangeByScore(byte[] key, Range range);

Source Link

Document

Remove elements with scores between Range#min and Range#max from sorted set with key .

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Remove elements with scores between {@code Range#min} and {@code Range#max} from sorted set with {@code key}.
 * /*ww  w .j  a  v  a  2s  . c o  m*/
 * @param key key
 * @param range range
 * @return Long
 * @since 1.6
 */
public static Long zRemRangeByScore(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRemRangeByScore(key, range);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Remove elements with scores between {@code Range#min} and {@code Range#max} from sorted set with {@code key}.
 * //from w  w w  .j a va2s  .c o m
 * @param key key
 * @param range range
 * @return Long
 * @since 1.6
 */
public Long zRemRangeByScore(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRemRangeByScore(key, range);
        }
    });
}