当前位置:网站首页>005_ redis_ Set set
005_ redis_ Set set
2022-04-23 02:08:00 【_ yummy_】
005_redis_set aggregate
1、Redis Medium Set Structure and Java Medium HashSet similar , It can be seen as value by null Of HashMap. Because it is also a hash surface , Therefore, it also has the ability to HashSet Similar features .
- Element disorder
- Element is not repeatable
- Quick search
- Support intersection 、 Combine 、 Difference set and other functions
2、Set Collect common commands
- SADD: Add one or more elements to the collection
- SREM: remove Set The specified element in
- SCARD: return Set The number of elements in
- SISMEMBER: Determine whether an element exists in Set in
- SMEMBERS: obtain Set All elements in
- SINTER: seek key1 And key2 Intersection
- SDIFF: seek key1 And key2 The difference between the set
- SUNION: seek key1 And key2 Union
(2) Related exercises
127.0.0.1:6379> sadd zs lisi wangwu zhaoliu
(integer) 3
127.0.0.1:6379> sadd lisi wangwu mazi ergou
(integer) 3
127.0.0.1:6379> SCARD zs
(integer) 3
127.0.0.1:6379> SINTER zs lisi
1) "wangwu"
127.0.0.1:6379> SDIFF zs lisi
1) "lisi"
2) "zhaoliu"
127.0.0.1:6379> SUNION zs lisi
1) "ergou"
2) "wangwu"
3) "zhaoliu"
4) "mazi"
5) "lisi"
127.0.0.1:6379> SISMENBER zs lisi
(error) ERR unknown command `SISMENBER`, with args beginning with: `zs`, `lisi`,
127.0.0.1:6379> SISmember zs lisi
(integer) 1
127.0.0.1:6379> SREM zs lisi
(integer) 1
127.0.0.1:6379> smembers zs
1) "wangwu"
2) "zhaoliu"


版权声明
本文为[_ yummy_]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230202506777.html
边栏推荐
- 2018 China Collegiate Programming Contest - Guilin Site J. stone game
- World Book Day 𞓜 a good book that technicians should not miss (it cutting-edge technology)
- 动态代理ip的测试步骤有哪些?
- Use of push() and pop()
- 不断下沉的咖啡业,是虚假的繁荣还是破局的前夜?
- 【汇编语言】从最底层的角度理解“堆栈”
- Kubernetes cluster installation based on Kirin SP10 server version
- What should I pay attention to when using proxy IP?
- Dynamic batch processing and static batch processing of unity
- LeetCode 283. Move zero (simple, array) Day12
猜你喜欢

How does Axure set the content of the text box to the current date when the page is loaded

每日一题(2022-04-22)——旋转函数

Talk about biology live broadcast: Dr. Wang Ziyuan, a lake view biology, exploring hepatitis B with gene therapy

011_RedisTemplate操作Hash

007_Redis_Jedis连接池

搭建网站是用物理机还是云主机好?

Common formatting problems after word writing

Thinkphp内核开发盲盒商城源码v2.0 对接易支付/阿里云短信/七牛云存储

010_StringRedisTemplate

001_redis设置存活时间
随机推荐
Halo open source project learning (I): project launch
Chinese scientists reveal a new mechanism for breaking through the bottleneck of rice yield
leetcode:27. 移除元素【count remove小操作】
Realize linear regression with tensorflow (including problems and solutions in the process)
Some tips for using proxy IP.
每日一题(2022-04-22)——旋转函数
What is a dial-up server and what is its use?
Common formatting problems after word writing
What should I pay attention to when using proxy IP?
浅析静态代理ip的三大作用。
[leetcode daily question] 396 Rotation function
What are the common proxy IP problems?
What is a proxy IP pool and how to build it?
[NK] Niuke monthly race 48 D
ThinkPHP kernel development blind box mall source code v2 0 docking easy payment / Alibaba cloud SMS / qiniu cloud storage
LeetCode 349. Intersection of two arrays (simple, array) Day12
Unicorn bio raised $3.2 million to turn prototype equipment used to grow meat into commercial products
013_基于Session实现短信验证码登录流程分析
Makefile文件是什么?
Is the availability of proxy IP equal to the efficiency of proxy IP?