Search code examples
redisredis-cli

Cannot get matching keys from Redis using redis-cli


I have this:

$ redis-cli -n 2 -h "$host" GET events:from_bitbucket:fc2c0983-d0f2-4211-aa2e-5382afd9b288
"[object Object]"

$ redis-cli -n 2 -h "$host" GET 'events:from_bitbucket:*'
(nil)

why does the first query work, but the second query responds with (nil)? Makes no sense. Same host and everything.


Solution

  • I think one good answer is simply:

    redis-cli -n 2 -h "$host" KEYS 'events:from_bitbucket:*'
    

    of course this only gives you all the matching keys, not the values.