How Do I Find Specified Keys and Traverse All Keys?
Finding Specified Keys
Big key and hot key analysis does not support key searching with specified conditions. To find keys with the specified prefix or suffix, use the SCAN command.
For example, to search for keys that contain the letter a in a Redis instance, run the following command in redis-cli:
./redis-cli -h {redis_address} -p {port} [-a password] --scan --pattern '*a*'
Traversing All Keys
Do not use the KEYS command to traverse all keys of an instance because the KEYS command is complex and may block Redis. To traverse all keys in a DCS Redis instance, run the following command in redis-cli:
./redis-cli -h {redis_address} -p {port} [-a password] --scan --pattern '*'
For details about the SCAN command, visit the Redis official website.
Redis Commands FAQs
- Does DCS for Redis Support Command Audits?
- How Do I Clear Redis Data?
- How Do I Find Specified Keys and Traverse All Keys?
- Why Do I Fail to Execute Some Redis Commands?
- Why is "permission denied" Returned When I Run the Keys Command in Web CLI?
- How Do I Rename High-Risk Commands?
- Does DCS for Redis Support Pipelining?
- Does DCS for Redis Support the INCR and EXPIRE Commands?
- Why Does a Redis Command Fail to Take Effect?
- Is There a Time Limit on Executing Redis Commands? What Will Happen If a Command Times Out?
- Can I Configure Redis Keys to Be Case-Insensitive?
- Can I View the Most Frequently Used Redis Commands?
- Common Web CLI Errors
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore