9951 explained code solutions for 126 technologies


redisFind key by value in Redis


This should be used for debugging purposes only:

for k in $(redis-cli KEYS '*'); do echo $k \"$(redis-cli GET $k)\"; done | grep "125"ctrl + c
redis-cli

launch Redis CLI interface in interactive mode

KEYS '*'

finds all keys on Redis server

do echo $k

for every key we will print key name

redis-cli GET $k

for every key we'll also get and print key value

grep "125"

and then we'll filter by required value (125 in our case)