Specially, I need to know:
How Range's gt, gte, lt, and lte methods work.
Is there a way to peek just one item? For ex. from command line it is possible to do:
zadd test 0 aaaa
(integer) 1zadd test 0 bbbb
(integer) 1zadd test 0 aa
(integer) 1zadd test 0 aaaaaa
(integer) 1zrangebylex test [aaaa [aaaa
1) "aaaa"
Can the same be done using RedisZSetCommands.zRangeByLex ?
Support for ZRANGEBYLEX
directly via ZSetOperations
and RedisZSet
is still an open issue. Though it is possible using RedisCallback
.
template.execute(new RedisCallback<Set<byte[]>>() {
@Override
public Set<byte[]> doInRedis(RedisConnection connection) throws DataAccessException {
return connection.zRangeByLex(key, Range.range().gte("aaaa").lte("aaaa"));
}
});