redis命令参考(四) set集合
A set is similar to a list, except it does not have a specific order and each element may only appear once.
Some of the important commands in working with sets are SADD,SREM, SISMEMBER, SMEMBERS and SUNION.
一、SADD
二、SREM
三、SISMEMBER
四、SMEMBERS
五、SUNION
> sadd mySet2 apple //创建mySet2,并添加元素 (integer) 1 > sadd mySet2 banana (integer) 1 > srem mySet football //删除元素 > smembers mySet //显示当前集合下的所有元素 1) "basketball" 2) "football" 3) "volleyball" > smembers mySet2 1) "banana" 2) "apple" 3) "kiwifruit" > sunion mySet mySet2 //显示mySet集合 和 mySet2 的并集 1) "volleyball" 2) "football" 3) "apple" 4) "basketball" 5) "banana" 6) "kiwifruit"
六、SISMEMBER
> sismember mySet football //判断mySet下是否有football元素 (integer) 1
1、以专家为榜样,不必自己重新探索
2、解构技能,找出实现80%效果的那20%
3、不要一心二用
4、练习练习再练习!然后获得即时反馈
5、坚持,不要在低谷期放弃
2、解构技能,找出实现80%效果的那20%
3、不要一心二用
4、练习练习再练习!然后获得即时反馈
5、坚持,不要在低谷期放弃