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

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

Introduction

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

Prototype

void trim(K key, long start, long end);

Source Link

Document

Trim list at key to elements between start and end .

Usage

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

/**
 * Remove elements from list /*  w  ww . ja va2s  .c o m*/
 * @param key
 * @param start
 * @param end 
 */
public void multiDeleteFromList(String key, int start, int end) {
    ListOperations opsForList = redisTemplate.opsForList();
    opsForList.trim(key, start, end); //start and end of range. -1 means up to end of list
}