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:
Comments
Post a Comment