In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what are redis sorted set types". In daily operation, I believe many people have doubts about redis sorted set types. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about "what are redis sorted set types?" Next, please follow the editor to study!
Sorted set is an ordered set, which adds a sequential attribute to set, which is being modified.
You can specify when you change the element, and each time you specify it, it will automatically re-adjust the order to the new value. Understandably, there are two columns.
Mysql table, one column memory value, one column storage order. In the operation, key is understood as the name of sorted set.
Brief introduction of Sorted Set type data operation instruction
Add key score member adds an element to the collection, and updates the corresponding score if the element exists in the collection.
Zrem key member deletes the specified element, 1 indicates success, and returns 0 if the element does not exist.
Zincrby key incr member increases the score value of the corresponding member, then moves the element and keeps the skip list
Preface. Returns the updated score value.
Zrank key member returns the ranking (subscript) of the specified elements in the collection, with the elements in the collection from small to large by score
Sorted.
Zrevrank key member is the same as above, but the elements in the collection are sorted by score from largest to smallest.
Zrange key start end is similar to an lrange operation that removes the elements of a specified interval from the collection. An ordered result is returned
Zrevrange key start end is the same as above, and the returned result is in reverse order by score.
Zrangebyscore key min max returns the elements in the collection where score is in a given interval.
Zcount key min max returns the number of score in the collection in a given interval.
Zcard key returns the number of elements in the collection.
Zscore key element returns the score for a given element.
Zremrangebyranzremrangebyrank key min max deletes the elements in the collection that rank in the given interval.
Zremrangebyscore key min max deletes elements in the collection where score is in a given interval
At this point, the study of "what are the types of redis sorted set" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.