redis 集合set 命令


sadd key member1 [member2] 向集合添加一個或多個成員

scard key 獲取集合的成員個數

sdiff key1 key2 返回 key1 中不存在 於其他集合中的元素

sdiffstore destination key1 key2 key3 返回 key1中不存在於其他集合中的元素 並存儲在destination中

sinter key1 [key2] 返回key1中存在於其他集合中的元素

sinterstore destination key1 key2 key3 返回key1存在於其他信息中的元素並存儲在destination中

sismember key member 判斷member元素是否是集合key的成員 1

smembers key 返回集合中的所有成員

smove source destination member 將member 元素從source集合移到destination集合中

spop key 移除並返回集合中的一個隨機元素

srandmember key [count]返回集合中 count 個隨機數

srem key member1 [member2] 移除集合中一個或多個成員

sunion key1 key2 返回所有給定集合的並集

sunionstore destination key1 [key2] 所有集合的並集存儲到destination 集合中

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM