当前位置:网站首页>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 |
边栏推荐
- 学习 Redis linux 安装Redis
- Browser access to swagger failed with error err_ UNSAFE_ PORT
- Dynamically add multiple tabs and initialize each tab page
- Redis database foundation
- matplotlib数据可视化三分钟入门,半小时入魔?
- [GYCTF2020]Node Game
- 作业7.19 顺序表
- Understand the execution process of try, catch and finally (including return) (the most detailed analysis of the whole network)
- 作业7.15 shell脚本
- 【代码源】每日一题 国家铁路
猜你喜欢
随机推荐
Neural network method -- Boston house price (regression problem)
初始Flask以及简单地上手应用
Read and write mongodb database files
【cf】Round 128 C. Binary String
基本的网络知识
浏览器访问swagger失败,显示错误ERR_UNSAFE_PORT
神经网络方法——美国波士顿房价(回归问题)
[GPLT] 2022 大众情人(floyd)
[GYCTF2020]Ez_Express
Publish Yum private server using nexus3 (offline intranet)
STM32+HC05串口蓝牙设计简易的蓝牙音箱
How can technologists start their personal brand? Exclusive teaching of top five KOLs
C#语言和SQL Server数据库技术
Swagger2 shows that there is a problem with the get interface, which can be solved with annotations
Stm32+hc05 serial port Bluetooth design simple Bluetooth speaker
What is the difference between mongodb and redis
Flask SSTI注入学习
Prim 最小生成树(图解)
In mysql, update and select are used together
[GKCTF 2021]easynode









