Redis Pattern matching within keys

15 views
Skip to first unread message

Anushri Mishra

unread,
Feb 22, 2018, 1:40:59 AM2/22/18
to Redis DB
hi, 

I have a data structure of type this in redis:

127.0.0.1:6379> HGETALL "BLWL:ine.com.br"

1) "domain:blacklist:ine.com.br"

2) "2541686"


Now if I wanna search for subkeys having blacklist in name how do I do that? 

I know for top level keys I can use keys *com whatever but I did not find anything for subkey search?


Any clues? Could it be done with Lua script?


Thanks.

Itamar Haber

unread,
Feb 22, 2018, 1:48:14 AM2/22/18
to Redis DB
Hello Anushri,

You can use `HSCAN` for a basic, glob-like pattern matching against field names in your hash. A Lua script can be used, on top of that, to reduce bandwidth and optionally perform more filteration on the results.

Cheers,

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber | Technology Evangelist
Redis Labs ~/redis

Mobile: +972 (54) 567 9692
Twitter: @itamarhaber
Skype: itamar.haber

Reply all
Reply to author
Forward
0 new messages