当前位置:网站首页>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
边栏推荐
- 今天终于会写System.out.println()了
- LeetCode 349. Intersection of two arrays (simple, array) Day12
- 浅析静态代理ip的三大作用。
- Easyswool environment configuration
- go语言打怪通关之 ⌈互斥锁和状态协程⌋
- 我国科学家揭示突破水稻产量瓶颈新机制
- 009_Redis_RedisTemplate入门
- 拨号vps会遇到什么问题?
- Chinese scientists reveal a new mechanism for breaking through the bottleneck of rice yield
- Campus transfer second-hand market source code
猜你喜欢
Analyze the advantages and disadvantages of tunnel proxy IP.
简洁开源的一款导航网站源码
R language advanced | generalized vector and attribute analysis
每日一题(2022-04-22)——旋转函数
Latin goat (20204-2022) - daily question 1
Campus transfer second-hand market source code
Want to experience homekit smart home? Why don't you take a look at this smart ecosystem
Shardingsphere introduction and sub table usage
What is an API interface?
【Chrome扩展程序】content_script的跨域问题
随机推荐
What should I pay attention to when using proxy IP?
Introduction to esp32 Bluetooth controller API
Use Xdebug breakpoint debugging in postman
89 logistic回歸用戶畫像用戶響應度預測
中金财富跟中金公司是一家公司吗,安全吗
Leetcode40 - total number of combinations II
MySQL C language connection
【ValueError: math domain error】
Redis memory recycling strategy
On LAN
如何选择一台好的拨号服务器?
001_redis设置存活时间
Applet reads files
每日一题(2022-04-22)——旋转函数
BGP服务器在什么业务场景会被用到?
什么是api接口?
What categories do you need to know before using proxy IP?
Shardingsphere broadcast table and binding table
Find the largest number of two-dimensional arrays
013_基于Session实现短信验证码登录流程分析