I have a Spring 4.3.9 app w/ spring-data-redis (1.8.7) and jedis (2.9.0). I can easily set and retrieve a ZSET using the code as below:
// Commented out -- but below line works fine too
// redisTemplate.opsForZSet().remove("score", userId);
Double scoreInRedis = redisTemplate.opsForZSet().score("score", userId);
redisTemplate.opsForZSet().add("score", userId, (double) score);
However, when I go to the redis CLI and try to retrieve the ZSET using the "score" key, I get nothing returned. So I've tried the following commands:
ZCARD "score" <-- this should give number of items wi
(integer) 0
ZSCORE "score" userId <--> I use the actual number here for the userId
(nil)
Other commands like ZREVRANGE or ZREVRANGEBYSCORE all return (nil).
I know that my key is being set because "info keyspace" shows a difference between keys and expires of exactly 1 -- which is my score ZSET. If I delete my ZSET from my Spring app, the number of keys and expiring keys is the same. So I know that my key is there somewhere.
Dude, where's my ZSET?? And how can I access it via the CLI? I can easily keep developing w/o accessing via the CLI but I'd like to understand where I'm off.