I can't find the command equivalent to keys in Stack Exchange Redis

人盡茶涼 提交于 2019-12-01 15:59:21

问题


I just switched to Stack Exchange Redis, and I could'nt find the command keys equivalent. Is it omitted or in some other place rather than getdatabase()?


回答1:


See https://stackexchange.github.io/StackExchange.Redis/KeysScan

This command (for reasons discussed in the link) is a server command, not a database command, and is available via GetServer(...).Keys(...).




回答2:


Also, as per

http://redis.io/commands/keys

Warning: consider KEYS as a command that should only be used in production environments with extreme care. It may ruin performance when it is executed against large databases. This command is intended for debugging and special operations, such as changing your keyspace layout. Don't use KEYS in your regular application code. If you're looking for a way to find keys in a subset of your keyspace, consider using sets.

Check if this helps :

https://github.com/StackExchange/StackExchange.Redis/blob/b823aed448ff3eff2c22b1cdae80446629fcf8bd/Docs/KeysScan.md



来源:https://stackoverflow.com/questions/22915942/i-cant-find-the-command-equivalent-to-keys-in-stack-exchange-redis

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