Redis-cli && bash find keys with empty values -
how can find elements in redis empty have keys this:
setting:1 setting:2 setting:442
etc
how can search redis-cli bash script command if key contains empty value redis-cli keys \* | xargs -l 1 redis-cli get
grep , check if value empty
found solution
redis-cli keys "settings:*" | xargs -l 1 redis-cli
the notion of empty key in redis non-existent - there no empty keys in redis. if key "becomes" empty (e.g. list popped final element), key not exist in redis anymore. here's example:
foo@bar:~$ redis-cli 127.0.0.1:6379> exists foo (integer) 0 127.0.0.1:6379> rpush foo bar (integer) 1 127.0.0.1:6379> exists foo (integer) 1 127.0.0.1:6379> lpop foo "bar" 127.0.0.1:6379> exists foo (integer) 0 127.0.0.1:6379>
Comments
Post a Comment