Map集合,key-map时候这个值是一个map集合
127.0.0.1:6379> hset myhash name hello
(integer) 1
127.0.0.1:6379> hget myhash name
"hello"
127.0.0.1:6379> HMSET myhash age 18 sex man
OK
127.0.0.1:6379> HMGET myhash age name
1) "18"
2) "hello"
127.0.0.1:6379> HGETALL myhash
1) "name"
2) "hello"
3) "age"
4) "18"
5) "sex"
6) "man"
127.0.0.1:6379> HDEL myhash name
(integer) 1
127.0.0.1:6379> HGETALL myhash
1) "age"
2) "18"
3) "sex"
4) "man"
127.0.0.1:6379> HLEN myhash
(integer) 2
127.0.0.1:6379> HEXISTS myhash name
(integer) 0
127.0.0.1:6379> HEXISTS myhash age
(integer) 1
127.0.0.1:6379> HKEYS myhash
1) "age"
2) "sex"
127.0.0.1:6379> HVALS myhash
1) "18"
2) "man"
127.0.0.1:6379> HSETNX myhash name hey
(integer) 1
127.0.0.1:6379> HSETNX myhash name world
(integer) 0
|