当前位置:网站首页>Redis set structure command
Redis set structure command
2022-07-25 09:33:00 【yu-yuan】
Set features :
1 . Disorder 2 . Uniqueness 3 . deterministic
| Add to collection ( Existing values will not enter the set ) | sadd key value ..... |
| Look at all the elements in the collection | smembers k vey |
| Delete elements from the collection | srem key value |
| Randomly select an element in the set and delete it after returning | spop key |
| Randomly extract an element without deleting | srandmember key |
| Check whether there is this element in the collection | sismember key value |
| See how many elements there are in this collection | scard |
| from set1 Move value To set2 | smore set1 set2 value |
| In multiple sets value Intersection | sinter set1 set2 ...... |
| In multiple sets value Union | sunion set1 set2 set3 |
| In multiple sets value The difference between the set | sdiff set1 set2 set3 |
| The intersection of multiple sets is stored in another set | sinterstore key set1 set2 set3 |
Ordered set (order set)
| Add to ordered collection | zadd key score1 value1 score2 value2 |
View the elements in the ordered collection ( Sort query ) withscores( At the same time, find out store) | zrange key start shop withscores( Don't write ) |
| Take value by identification (score) Inquire about (num) Take a few | zrangebyscore key min max After add limit offset num |
| Query out value In the set score Which place is it | zrank key value ( Ascending ) zrevrange key value ( Descending ) |
Delete that element in the collection Conditions term1~term2 Between Elements Delete | zrem key value1 value2..... zremrangebyscore key term1 term2 |
| Statistics set The number of elements in | zcard key |
| Statistics set in term1~term2 Between the elements | zcount key term1 term2 |
| Operations between multiple sets | zinterstore set3 num( identification ) set1 set2 aggregate sum/min/max |
| Merge two sets And find the intersection | zinterstore set3 num( identification ) set1 set2 withscores |
边栏推荐
- 语音聊天app源码-钠斯网络源码出品
- 数据控制语言(DCL)
- Go基础1
- Swagger2 shows that there is a problem with the get interface, which can be solved with annotations
- 正奇边形可划分成多少区域
- Jspdf generates PDF files. There is a problem of incomplete files. Files are downloaded in the background, but not in the foreground
- 【代码源】每日一题 - 排队
- Week小结
- Install MySQL in Ubuntu and create new users
- 作业7.21 约瑟夫环问题与进制转换
猜你喜欢

Analysis of five data structure principles of redis

UI——无限轮播图和分栏控制器

正奇边形可划分成多少区域
![[GYCTF2020]Ez_ Express](/img/ce/02b90708f215715bb53cacfd4c21f0.png)
[GYCTF2020]Ez_ Express

作业7.21 约瑟夫环问题与进制转换

@4-1 CCF 2020-06-1 线性分类器

~5 ccf 2021-12-2 序列查询新解

MongoDB数据库文件的读与写

在Ubuntu中安装MySQL并创建新用户

How to deploy the jar package to the server? Note: whether the startup command has nohup or not has a lot to do with it
随机推荐
Data query language (DQL)
深入解读C语言随机数函数和如何实现随机数
【代码源】每日一题 分割(nlogn&n解法)
@3-1 CCF 2020-09-1 称检测点查询
【cf】Round 128 C. Binary String
Numpy - Construction of array
¥1-2 例2.2 将两个集合的并集放到线性表中
[GKCTF 2021]easynode
[GYCTF2020]Ez_Express
数据预处理
[GKCTF 2021]easynode
Idea hot deployment
神经网络方法——美国波士顿房价(回归问题)
Basic network knowledge
MongoDB数据库文件的读与写
[De1CTF 2019]SSRF Me
[De1CTF 2019]SSRF Me
uni-app小程序如何自定义标题内容(如何解决小程序标题不居中)
Front page printing
@2-1 CCF 2020-12-01 期末预测之安全指数