##String
*字符串
set string1 bin
get string1 //bin
*数字
set string2 3
incr string2 //4 自增
decrby string2 2 //2 减2操作
List(队列)
lpush list1 redis
lpush list1 mongodb
lpush list1mysql
lpop list1 //mysql
rpop list1 //redis
llen list1 //1 返回长度
lrange list1 0 10 //返回0-10索引的值
Set(集合)
sadd set1 12
scard set1 //返回长度
smembers set1 //返回所有元素
sismember set1 12 //是否是其元素
srem set1 12 //删除元素
Hash(哈希)
hset hash1 key1 redis
hset hash1 key2 mysql
hget hash1 key1
hgetall hash1 // 获得所有元素key值和value值
hlen key1 //获取hash长度
Sort set(有序集合)
zadd zset1 10.1 val1
zadd zset1 9.1 val2
zadd zset1 11.1 val3
zrange zset1 0 2 withscores //通过分数从小到大排列