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)06/01 Report--
Editor to share with you how to delete the contents of the hash table in redis. I hope you will gain a lot after reading this article. Let's discuss it together.
Hash:
Redis hash is a mapping table for field and value of type string, and hash is particularly suitable for storing objects.
Each hash in Redis can store 232-1 key-value pairs (more than 4 billion).
Example:
127.0.1 HMSET runoobkey name "redis tutorial" description "redis basic commands for caching" likes 20 visitors 23000OK127.0.0.1:6379 > HGETALL runoobkey1) "name" 2) "redis tutorial" 3) "description" 4) "redis basic commands for caching" 5) "likes" 6) "20" 7) "visitors" 8) "23000"
Delete command:
Hdel command
The Redis Hdel command is used to delete one or more specified fields in the hash table key, and fields that do not exist are ignored.
The basic syntax for redis Hdel commands is as follows:
Redis 127.0.0.1 6379 > HDEL KEY_NAME FIELD1.. FIELDN
Return value:
The number of fields that were successfully deleted, excluding fields that were ignored.
Redis 127.0.0.1 redis 6379 > HSET myhash field1 "foo" (integer) 1redis 127.0.0.1 1redis 127.0.0.1 1redis 6379 > HDEL myhash field1 (integer) 1redis 127.0.0.1 1redis 6379 > HDEL myhash field2 (integer) 0 after reading this article, I believe you have some understanding of how to delete hash table contents in redis, want to know more about it, welcome to follow the industry information channel, thank you for your reading!
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.