Redis 中的 SINTER 命令函数

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

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

SINTER - 返回值

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

无涯教程网

链接:https://www.learnfk.comhttps://www.learnfk.com/redis/sets-sinter.html

来源:LearnFk无涯教程网

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"

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

技术教程推荐

快速上手Kotlin开发 -〔张涛〕

透视HTTP协议 -〔罗剑锋(Chrono)〕

高并发系统设计40问 -〔唐扬〕

MySQL 必知必会 -〔朱晓峰〕

程序员的个人财富课 -〔王喆〕

超级访谈:对话汤峥嵘 -〔汤峥嵘〕

现代React Web开发实战 -〔宋一玮〕

结构思考力 · 透过结构看思考 -〔李忠秋〕

程序员职业规划手册 -〔雪梅〕

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