注意
set 值不能重复
添加一个或多个值
127.0.0.1:6379[2]> sadd mylist gaobin (integer) 1 127.0.0.1:6379[2]> sadd mylist gaobi (integer) 1 127.0.0.1:6379[2]> sadd mylist gaob (integer) 1 127.0.0.1:6379[2]> sadd mylist gao (integer) 1
获取值
127.0.0.1:6379[2]> smembers mylist 1) "gaobi" 2) "gaobin" 3) "gaob" 4) "gao"
判断某一个值是否在集合中
127.0.0.1:6379[2]> sismember mylist gaobi (integer) 1 127.0.0.1:6379[2]> sismember mylist gaobiss (integer) 0
获取集合中的个数
127.0.0.1:6379[2]> scard mylist (integer) 4