简体   繁体   English

在StackExchange.Redis中按键模式获取值

[英]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 . 我正在尝试使用模式来检索Stackexchange.Redis匹配模式的所有键。

Code

KEYS *o*

On the project homepage is linked Where are KEYS , SCAN , FLUSHDB etc? 在项目主页上链接了哪里有KEYSSCANFLUSHDB等? which gives full details on how to access this, and why it isn't on IDatabase . 它提供了有关如何访问它的完整详细信息,以及它不在IDatabase I should point out that you should avoid KEYS on a production server. 我应该指出你应该在生产服务器上避免使用KEYS 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. 如果可用,库将自动尝试使用SCAN - 这样做的危害较小,但仍应谨慎对待。 It would be preferable to explicitly store related keys in a set or hash. 最好将相关密钥明确地存储在集合或散列中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM