Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get values by key pattern in StackExchange.Redis

I'm trying to use a pattern to retrieve all keys matching a pattern by Stackexchange.Redis.

Code

KEYS *o*
like image 729
Amir Movahedi Avatar asked Aug 16 '14 18:08

Amir Movahedi


1 Answers

On the project homepage is linked Where are KEYS, SCAN, FLUSHDB etc? which gives full details on how to access this, and why it isn't on IDatabase. I should point out that you should avoid KEYS on a production server. The library will automatically try to use SCAN instead if it is available - which is less harmful but should still be treated with some caution. It would be preferable to explicitly store related keys in a set or hash.

like image 191
Marc Gravell Avatar answered Nov 19 '22 07:11

Marc Gravell