In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how to use ordered set types in Redis. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
1. Users get likes
Zadd key [NX | XX] [CH] [INCR] score member [score member...]
If this user later gets likes from other users, we can use the zincrby command to directly modify the score of the current ordered collection.
Zincrby key increment member
Note: when executing the zincrby command, if the current key does not exist, it is equivalent to executing the zadd command.
two。 The user is disliked.
There can be two situations:
When the user cancels giving likes, we can still use the zincrby command mentioned on the computer, but write the increment parameter as a negative number.
In another case, the current user is deleted, so in this case, we will use the zrem command.
Zrem key member [member...]
3. Get the top 10 praises
Zrevrange key start stop [WITHSCORES]
On how to use ordered collection types in Redis to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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
Step 1: declare: `step 2: TouchAction ta = new TouchAction (drive)
© 2024 shulou.com SLNews company. All rights reserved.