1.redis 的控制台命令基本语法:
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 "hello"
(integer) 0
说明想重复设置“hello”两条是不行的
2.查看myset的总数
redis 127.0.0.1:6379> SCARD myset
(integer) 2
3.查看myset中具体的元素
127.0.0.1:6379> smembers myset
1) "hello"
1) "foo"