(三)Redis——Set

SADD key value

SMEMBERS

127.0.0.1:6379> SADD set aaa
1
127.0.0.1:6379> SMEMBERS set
aaa
127.0.0.1:6379> SADD set aaa
0
127.0.0.1:6379> SMEMBERS set
aaa

SISMEMBER

判断 aaa 是否在 set 中

127.0.0.1:6379> SISMEMBER set aaa
1
127.0.0.1:6379> SISMEMBER set bbb
0
127.0.0.1:6379> SREM set aaa
1
127.0.0.1:6379> SMEMBERS set

集合的操作

127.0.0.1:6379> SINTER SUNION SDIFF

你可能感兴趣的:(Redis,redis)