Reputation: 109
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()?
Upvotes: 7
Views: 7637
Reputation: 1064024
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(...)
.
Upvotes: 8
Reputation: 1176
Also, as per
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 :
Upvotes: 5