Redis 中的 SINTER 命令函数

首页 / Redis入门教程 / Redis 中的 SINTER 命令函数

Redis SINTER 命令指定集合相交之后获取集合的元素,不存在的键被认为是空集,如果其中一个键为空集,则输出集也为空。

SINTER - 返回值

返回数组,列出输出集的元素。

无涯教程网

SINTER - 语法

以下是Redis SINTER 命令的基本语法。

redis 127.0.0.1:6379> SINTER KEY KEY1..KEYN

SINTER - 示例

redis 127.0.0.1:6379> SADD myset "hello" 
(integer) 1 
redis 127.0.0.1:6379> SADD myset "foo"
(integer) 1 
redis 127.0.0.1:6379> SADD myset "bar" 
(integer) 1 
redis 127.0.0.1:6379> SADD myset2 "hello" 
(integer) 1 
redis 127.0.0.1:6379> SADD myset2 "Learnfk" 
(integer) 1 
redis 127.0.0.1:6379> SINTER myset myset2 
1) "hello"

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

Nginx核心知识150讲 -〔陶辉〕

重学前端 -〔程劭非(winter)〕

Service Mesh实战 -〔马若飞〕

系统性能调优必知必会 -〔陶辉〕

Go 并发编程实战课 -〔晁岳攀(鸟窝)〕

乔新亮的CTO成长复盘 -〔乔新亮〕

基于人因的用户体验设计课 -〔刘石〕

Go 语言项目开发实战 -〔孔令飞〕

大厂设计进阶实战课 -〔小乔〕

好记忆不如烂笔头。留下您的足迹吧 :)