java - Redis List, pop without removing -


i'm using redistemplate(from spring) in java app. need pop list of elements correspondenting values, without removing it. suggestions?

you can peek @ item rather popping using range command.

with spring, redistemplate instance, can listoperations instance using opsforlist() method, , then:

  • listop.range(key, 0, 0) return first (left) item without popping it

  • listop.range(key, -1, -1) return last (right) item without popping it

see documentation at:

http://static.springsource.org/spring-data/data-keyvalue/docs/1.0.x/api/org/springframework/data/keyvalue/redis/core/redistemplate.html

http://static.springsource.org/spring-data/data-keyvalue/docs/1.0.x/api/org/springframework/data/keyvalue/redis/core/listoperations.html


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -