1.设置与获取
127.0.0.1:6379> set 1 "ab"
OK
127.0.0.1:6379> get 1
"ab"
127.0.0.1:6379> append 1 bc
(integer) 3
127.0.0.1:6379> get 1
"abc"

2.同时设置与获取多个key
127.0.0.1:6379> mset 1 a 2 b 3 c
OK
127.0.0.1:6379> get 2
"b"
127.0.0.1:6379> mget 1 2 3
1) "a"
2) "b"
3) "c"

3.字段赋值:
127.0.0.1:6379> hset car1 name c1
(integer) 1
127.0.0.1:6379> hget car1 name
"c1"
127.0.0.1:6379> hmset car1 name c1 price 100
OK
127.0.0.1:6379> hgetall car1
1) "name"
2) "c1"
3) "price"
4) "100"
127.0.0.1:6379> hincrby car1 price 200
(integer) 300


4.判断是否存在:
127.0.0.1:6379> hexists car1 name
(integer) 1

5.删除记录:
127.0.0.1:6379> hdel car1 price
(integer) 1
127.0.0.1:6379> hgetall car1
1) "name"
2) "c1"

6.显示所有的key或value
127.0.0.1:6379> hkeys car1
1) "name"
127.0.0.1:6379> hvals car1
1) "c1"

7.增减数值
127.0.0.1:6379> set num 1
OK
127.0.0.1:6379> incr num
(integer) 2
127.0.0.1:6379> incrby num 2
(integer) 4
127.0.0.1:6379> decr num
(integer) 3
127.0.0.1:6379> decrby num 2
(integer) 1
127.0.0.1:6379> incrbyfloat num 0.5
"1.5"