当前位置:网站首页>[redis] set type
[redis] set type
2022-06-29 01:58:00 【Riding a snail chasing a missile '】
List of articles
One 、Set type
Redis Medium Set The type and java Medium HashSet similar , It can be seen as a value by null Of HashMap, Have and HashMap Similar features :
- disorder
- Elements cannot be repeated
- Quick search
- Support intersection 、 Combine 、 Difference set and other functions

The basic general commands are shown in the figure above , Here is a detailed introduction !
1.1 SADD & SREM & SCARD

SADD key member …: towards set Add one or more elements to
SREM key member …: remove set The specified element in
SCARD key: return set The number of elements in

1.2 SISMEMBER & SMEMBERS

- SISMEMBER key member: Determine whether an element exists or not set in
- SMEMBERS key : obtain set All the elements in

1.3 SINTER & SDIFF & SUNION
SINTER key1 key2 …: seek key1 And key2 Intersection

SDIFF key1 key2 …: seek key1 And key2 The difference between the set

SUNION key1 key2 …: seek key1 and key2 Union

Case study : Use the following data as Redis Of Set Collection to store :· Zhang San's good friends are : Li Si 、 Wang Wu 、 Zhao Liu ; Li Si's good friends are : Wang Wu 、 Pockmarks 、 Two dog utilization Set The command implements the following functions :

- Calculate how many friends Zhang San has

- Calculate what friends Zhang San and Li Si have in common

- Check who is Zhang San's friend but not Li Si's friend

- Who are Li's three and four friends in total

- Judge whether Li Si is Zhang San's good friend

- Judge whether Zhang San is Li Si's good friend

- Remove Li Si from Zhang San's friend list

边栏推荐
- Zhongyi technology resumed the review status of the gem IPO, and xuxiaofei no longer acted as a practicing lawyer
- How to become a senior digital IC Design Engineer (3-5) tools: Spyglass Technology
- PHP hospital network reservation management system source code, hospital consultation reservation registration OA system (commercial or graduation design)
- [learn FPGA programming from scratch -50]: Vision - how are chips made? The thirteen steps of chip manufacturing.
- ASP. Design and implementation of net+sql online alumni list
- Edrawmax mind map, edrawmax organization chart
- Redis data migration (III)
- Understand flex layout in an article
- Why install an SSL certificate on a web site?
- Oculusrifts and unity UI interaction (1) - Overview
猜你喜欢

【Redis】Set类型

Design and development of VB mine sweeping game

Share the code technology points and software usage of socket multi client communication

基于 RISC-V SoC 的可配置 FFT 系统设计(1)引言

In simple terms, server intrusion prevention

【Redis】List类型

如何成为一名高级数字 IC 设计工程师(4-2)脚本篇:Verilog HDL 代码实现的文件读写操作

Test a CSDN free download software

ASP. Design and implementation of net+sql online alumni list

PHP hospital network reservation management system source code, hospital consultation reservation registration OA system (commercial or graduation design)
随机推荐
如何成为一名高级数字 IC 设计工程师(4-2)脚本篇:Verilog HDL 代码实现的文件读写操作
Testing until you're 35? The 35 + test will lead to unemployment?
Exclusive analysis | real situation of software test about resume and interview
想请教股票开户要认识谁?现在网上开户安全么?
Rasa dialogue robot helpdesk (V)
Near consensus mechanism
Near's storage stacking
利用kubernetes資源鎖完成自己的HA應用
Using autogluon to forecast house price
独家分析 | 软件测试关于简历和面试的真实情况
P7 Erkai early know - registration and application creation
Introduction to UE gameplay 44 (animation import FBX and production standard)
Why is it recommended that you choose the self research company as much as possible
TypeScript(6)函数
如何成为一名高级数字 IC 设计工程师(6-6)数字 IC 验证篇:系统级仿真
Which is the best billing method for okcc call center
NOIP2006-2018 提高组 初赛试题完善程序题 CSP-S 2019 2020 初赛试题完善程序题
什么叫股票线上开户?网上开户安全么?
Oculusrifts and unity UI interaction (1) - Overview
Fibonacci sequence