Get values by key pattern in StackExchange.Redis

泄露秘密 提交于 2019-12-08 17:28:24

问题


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

Code

KEYS *o*

回答1:


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.



来源:https://stackoverflow.com/questions/25342514/get-values-by-key-pattern-in-stackexchange-redis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!