方法 c参数 s说明
Long add(K key, V... values);
K key:集合key 
V... values:key对应的值
向集合中添加一个或多一个元素
Long remove(K key, Object... values);
K key:集合key 
V... values:key对应的值
删除集合中一个或多个元素
V pop(K key);

K key:集合key 
随机删除集合中一个元素
List<V> pop(K key, long count);
K key:集合key 
long count:数量
随机删除集合中一个或多个元素
Boolean move(K key, V value, K destKey);
K key:集合key 
V value:key对应的某个值
K destKey:目标集合
将某一个集合中的元素移动到目标集合中
Long size(K key);
K key:集合key 
获取集合长度
Boolean isMember(K key, Object o);
K key:集合key 
V value:key对应的某个值
检查集合中是否存在某个元素
Set<V> intersect(K key, K otherKey);
K key:集合A的key 
K otherKey:集合B的key
获取集合A和集合B的交集
Set<V> intersect(K key, Collection<K> otherKeys);

K key:集合A的key
Collection<K> otherKeys:其他集合的集合(可多个)
 获取集合A和其他的交集

Long intersectAndStore(K key, K otherKey, K destKey);

K key:集合A的key 
K otherKey:集合B的key
K destKey:集合C的key
 将集合A和集合B的交集存放到集合C中

Long intersectAndStore(K key, Collection<K> otherKeys, K destKey);

K key:集合A的key 
Collection<K> otherKeys:其他集合的key(可多个)
K destKey:集合C的key
 将集合A和其他集合的交集存放到集合C中

Set<V> union(K key, K otherKey);

K key:集合A的key 
K otherKey:集合B的key
 获取集合A和集合B集合合并后的集合

Set<V> union(K key, Collection<K> otherKeys);

K key:集合A的key 
Collection<K> otherKeys:其他集合的key(可多个)
 获取集合A和其他集合(多个)合并后的集合

Long unionAndStore(K key, K otherKey, K destKey);

K key:集合A的key 
K otherKey:集合B的key
K destKey:集合C的key
 将集合A和集合B合并后的结果存放到集合C中

Long unionAndStore(K key, Collection<K> otherKeys, K destKey);

K key:集合A的key 
Collection<K> otherKeys:其他集合的key(可多个)
K destKey:集合C的key
 将集合A和其他集合合并后的结果存放到集合C中

Set<V> difference(K key, K otherKey);

K key:集合A的key 
K otherKey:集合B的key
 获取集合A和集合B的差集

Set<V> difference(K key, Collection<K> otherKeys);

K key:集合A的key 
Collection<K> otherKeys:其他集合的key(可多个)
 获取集合A和其他集合的差集

Long differenceAndStore(K key, K otherKey, K destKey);

K key:集合A的key 
K otherKey:集合B的key
K destKey:集合C的key
 将集合A和集合B的差集存放到集合C中

Long differenceAndStore(K key, Collection<K> otherKeys, K destKey);

K key:集合A的key 
Collection<K> otherKeys:其他集合的key(可多个)
K destKey:集合C的key
  将集合A和其他集合的差集存放到集合C中

Set<V> members(K key);

K key:集合A的key 
 获取集合中的多有元素

V randomMember(K key);

K key:集合A的key 
 在集合中随机获取一个元素

Set<V> distinctRandomMembers(K key, long count);

K key:集合A的key 
count:数量
 在集合中随机获取count个不同的元素

List<V> randomMembers(K key, long count);

K key:集合A的key 
count:数量
 在集合中随机获取count个元素

Cursor<V> scan(K key, ScanOptions options);

K key:集合A的key 
ScanOptions options:扫描选项对象
 扫描整个集合一匹配所需元素

使用SetOperations(无序)操作redis的更多相关文章

  1. springboot之使用redistemplate优雅地操作redis

    概述 本文内容主要 关于spring-redis 关于redis的key设计 redis的基本数据结构 介绍redis与springboot的整合 sringboot中的redistemplate的使 ...

  2. 使用python来操作redis用法详解

    1.redis连接 redis提供两个类Redis和StrictRedis用于实现Redis的命令,StrictRedis用于实现大部分官方的命令,并使用官方的语法和命令,Redis是StrictRe ...

  3. Java使用Jedis操作Redis大全

    Java操作Redis需要导入两个jar: commons-pool2-2.4.2.jar jedis-2.1.0.jar package com.chinasofti.test; import ja ...

  4. [转]使用python来操作redis用法详解

    转自:使用python来操作redis用法详解 class CommRedisBase(): def __init__(self): REDIS_CONF = {} connection_pool = ...

  5. edis 以及 Python操作Redis

    Redis 以及 Python操作Redis   Redis Redis是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Redis有以下特点: -- Redis支持数据的持 ...

  6. Redis基础知识、命令以及java操作Redis

    1 nosql的概念 sql:操作(关系型)数据库的标准查询语言 关系型数据库(rdbms):以关系(由行和列组成的二维表)模型为核心数据库,有表的储存系统.(mysql.oracle.sqlserv ...

  7. Redis 以及 Python操作Redis

    Redis Redis是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Redis有以下特点: -- Redis支持数据的持久化,可以将内存中的数据保存在磁盘中,重启的时候可 ...

  8. python操作redis用法详解

    python操作redis用法详解 转载地址 1.redis连接 redis提供两个类Redis和StrictRedis用于实现Redis的命令,StrictRedis用于实现大部分官方的命令,并使用 ...

  9. redis 原生操作 & python操作redis

    一.基本介绍 1.简介 Redis是由意大利人Salvatore Sanfilippo(网名:antirez)开发的一款内存高速缓存数据库.Redis全称为:Remote Dictionary Ser ...

  10. 最全的Java操作Redis的工具类,使用StringRedisTemplate实现,封装了对Redis五种基本类型的各种操作!

    转载自:https://github.com/whvcse/RedisUtil 代码 ProtoStuffSerializerUtil.java import java.io.ByteArrayInp ...

随机推荐

  1. Mybatis中使用UpdateProvider注解实现根据主键批量更新

    Mapper中这样写: @UpdateProvider(type = SjjcSqlProvider.class, method = "updateTaskStatusByCBh" ...

  2. C#中委托和代理的深刻理解(转载)

    在写代码的过程中遇到了一个问题,就是" .net CallbackOnCollectedDelegate 垃圾回收问题. " 使用全局钩子的时候出现: globalKeyboard ...

  3. 针对 npm ERR! cb() never called! 问题

    在开发项目安装依赖时(npm install) 往往会报  npm ERR! cb()never called!的错误 如图: 解决方法: 一.首先要以管理员模式打开cmd清除你的npm缓存 : np ...

  4. python3笔记

    python3 Python3 基本数据类型 Python 中有六个标准的数据类型: Numbers(数字) Python可以同时为多个变量赋值,如a, b = 1, 2. 一个变量可以通过赋值指向不 ...

  5. 在python中安装basemap

    在python中安装basemap 1. 确保python环境安装完毕且已配置好环境变量 2. 安装geos: pip install geos 3. 下载.whl文件: (1)pyproj‑1.9. ...

  6. 解决Pycharm无法使用已经安装Selenium的问题

    重要:参考资料 当前版本 python版本:2.7 pycharm: 2017 原来本机是已经安装了2.7和selenium,新安装了一个pycharm的ide,于是selenium总是安装报错.At ...

  7. u-boot.bin生成过程分析

    ELF格式“u-boot”文件的生成规则如下,下面对应Makefile的执行过程分别分析各个依赖. $(obj)u-boot: depend version $(SUBDIRS) $(OBJS) $( ...

  8. IO复用——select系统调用

    1.select函数 此函数用于在一段时间内,监听用户感兴趣的文件描述符上的可读.可写和异常等事件. #include<sys/select.h> int select(int nfds, ...

  9. SGU 495

    #include<bits/stdc++.h> using namespace std; #define ll long long ; ; int n,m; double dp[N]; / ...

  10. Spring中的设计模式--观察者模式

    spring在容器中使用了观察者模式: 一.spring事件:ApplicationEvent,该抽象类继承了EventObject类,jdk建议所有的事件都应该继承自EventObject. 二.s ...