Example usage for org.springframework.data.redis.core ListOperations remove

List of usage examples for org.springframework.data.redis.core ListOperations remove

Introduction

In this page you can find the example usage for org.springframework.data.redis.core ListOperations remove.

Prototype

@Nullable
Long remove(K key, long count, Object value);

Source Link

Document

Removes the first count occurrences of value from the list stored at key .

Usage

From source file:com.easarrive.datasource.redis.etago.AbstractDaoByRedisTemplate.java

public Long listDelete(K key, long index) {
    ListOperations<K, V> listOperations = redisTemplate.opsForList();
    Long count = listOperations.remove(key, index, null);
    return count;
}

From source file:com.company.project.service.dao.RedisDao.java

/**
 * Remove an element from list/*from  www. j  a  v a  2 s.  co  m*/
 * @param key
 * @param index
 * @param object 
 */
public void removeFromList(String key, int index, Object object) {
    ListOperations opsForList = redisTemplate.opsForList();
    opsForList.remove(key, index, object); //start and end of range. -1 means up to end of list
}