How can I get all of the sets in redis?

I know the KEYS command, but that only returns the keys (I’m guessing all of the keys with type String), and apparently sets aren’t considered keys. KEYS command return results no matter what data type are your keys, since it searches key names. At the lowest level of abstraction each data type in redis is … Read more

Why is data getting stored with weird keys in Redis when using Jedis with Spring Data?

Ok, googled around for a while and found help at It happened because of Java serialization. The key serializer for redisTemplate needs to be configured to StringRedisSerializer i.e. like this: <bean id=”jedisConnectionFactory” class=”” p:host-name=”${redis.server}” p:port=”${redis.port}” p:use-pool=”true”/> <bean id=”stringRedisSerializer” class=””/> <bean id=”redisTemplate” class=”” p:connection-factory-ref=”jedisConnectionFactory” p:keySerializer-ref=”stringRedisSerializer” p:hashKeySerializer-ref=”stringRedisSerializer” /> Now the key in redis is vc:501381. Or … Read more

Redis: To set timeout for a key value pair in Set

Unfortunately, no. Redis’ “containers” (i.e. lists, hashes, sets and sorted sets) do not support per-member expiry, although this functionality has been requested many times in the past. You can, however, implement your own logic to achieve that result. There are several possible approaches to address this – here’s one example. Instead of using a set, … Read more

how to get keys which does not match a particular pattern in redis?

IMPORTANT: always use SCAN instead of (the evil) KEYS Redis’ pattern matching is somewhat functionally limited (see the implementation of stringmatchlen in util.c) and does not provide that which you seek ATM. That said, consider the following possible routes: Extend stringmatchlen to match your requirements, possibly submitting it as a PR. Consider what you’re trying … Read more

WSL Redis encountered System has not been booted with systemd as init system (PID 1). Can’t operate [closed]

Instead, use: sudo service redis-server start I had the same problem, stopping/starting other services from within Ubuntu on WSL. This worked, where systemctl did not. And one could reasonably wonder, “how would you know that the service name was ‘redis-server’?” You can see them using service –status-all