In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "how to use the redis iterator scan and hscan commands". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The format is as follows:
SCAN cursor [MATCH pattern] [COUNT count] HSCAN key cursor [MATCH pattern] [COUNT count]
The SCAN command is a cursor-based iterator, which means that each time the command is called, it needs to use the cursor returned by the last call as the cursor parameter of the call to continue the previous iterative process. When the cursor parameter of the SCAN command is set to 0, the server will start a new iteration, and when the server returns a cursor with a value of 0 to the user, it indicates that the iteration has ended. HSCAN is the same as the SCAN command.
1. Hash operation 1, check how many records there are in hash 127.0.0.1 hgetall pms:1 6379 [1] > hgetall pms:1 1) "stock" 2) "12" 3) "freeze" 4) "10" 5) "stock:1" 6) "11" 7) "stock:2" 8) "23" 9) "stock:freeze:1" 10) "111" 11) "stock:5" 12) "1212" 2 Blur view the key under pms:1 127.0.0.1 hscan pms:1 0 match stock:* count 1001) "0" 2) 1) "stock:1" 2) "11" 3) "stock:2" 4) "23" 5) "stock:freeze:1" 6) "111" 7) "stock:5" 8) "1212" 3 Blur view the key 127.0.0.1 match stock* count 6379 [1] > hscan pms:1 0 match stock* count 1001) "0" 2) 1) "stock" 2) "12" 3) "stock:1" 4) "11" 5) "stock:2" 6) "23" 7) "stock:freeze:1" 8) "111" 9) "stock:5" 10) "1212" 4 Blurred view the key 127.0.0.1 match stock:freeze:* count 6379 [1] > hscan pms:1 0 match stock:freeze:* count 1001) "0" 2) 1) "stock:freeze:1" 2) "111" 2, key-value pair operation 1 Check how many keys there are 127.0.0.1 pms:freeze:21 6379 [1] > keys * 1) "pms:1" 2) "pms:freeze:21" 3) "pms:10" 4) "pms:11" 5) "pms:9" 6) "pms:4" 7) "name" 8) "pms:5" 9) "pms:8" 10) "pms:7" 11) "pms:2" 12) "go:123" 13) "pms:3" 14) "pms:6" 2 Fuzzy search key for pms:* 127.0.0.1 match pms:* count 6379 [1] > scan 0 match pms:* count 10 1) "3" 2) 1) "pms:1" 2) "pms:8" 3) "pms:freeze:21" 4) "pms:5" 5) "pms:11" 6) "pms:9" 7) "pms:4" 8) "pms:3" 9) "pms:6" 3 Fuzzy search key for pms:* Cursor starts at 3 127.0.0.1 pms:10 6379 [1] > scan 3 match pms:* count 10 1) "0" 2) 1) "pms:10" 2) "pms:7" 3) so much for "pms:2" and "how to use the redis iterator scan and hscan commands" Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.