语法:HDEL key field [field ...]
127.0.0.1:6379> HSET hdel 1 2 127.0.0.1:6379> HVALS hdel 127.0.0.1:6379> HDEL hdel 1 127.0.0.1:6379> HVALS hdel
语法:HEXISTS key field
127.0.0.1:6379> HEXISTS hexists 2 127.0.0.1:6379> HSET hexists 2 4 127.0.0.1:6379> HEXISTS hexists 2
语法:HGET key field
127.0.0.1:6379> HGET hget 1 127.0.0.1:6379> HSET hget 1 1 127.0.0.1:6379> HGET hget 1
语法:HGETALL key
语法:HINCRBY key field increment
127.0.0.1:6379> HSET hincrby 1 4 127.0.0.1:6379> HINCRBY hicrby 1 3 127.0.0.1:6379> HGET hincrby 1 127.0.0.1:6379> HINCRBY hincrby 1 3 127.0.0.1:6379> HGET hincrby 1 127.0.0.1:6379> HGET hicrby 1
语法:HINCRBYFLOAT key field increment
127.0.0.1:6379> HSET hincrbyfloat 1 5 127.0.0.1:6379> HINCRBYFLOAT hincrbyfloat 1 5.1 127.0.0.1:6379> HGET hincrbyfloat 1
语法:HKEYS key
127.0.0.1:6379> HSET hkeys 1 2 2 3 3 4 127.0.0.1:6379> HKEYS hkeys
语法:HLEN key
127.0.0.1:6379> HSET hlen 1 2 2 3 3 4 127.0.0.1:6379> HLEN hlen
语法:HMGET key field [field ...]
127.0.0.1:6379> HMGET 1 2 2 3 3 4 127.0.0.1:6379> HMGET 1 2 3
语法:HSCAN key cursor [MATCH pattern] [COUNT count]
cursor是游标:游标以0开始,如果结果返回的游标不是0,表示遍历还没有结束,需要使用返回的游标继续遍历后面的结果,pattern是匹配模式,count表示从数据集中返回多少元素,默认为10。但是当集合内成员数小于等于512的时候,count是不会生效的,count的默认值也不是10,而是集合大小。单数为键双数为值。
127.0.0.1:6379> HSET hscan1 1 2 2 3 3 4 4 5 127.0.0.1:6379> HSCAN hscan1 0 127.0.0.1:6379> HSCAN hscan2 0 COUNT 2 127.0.0.1:6379> HSCAN hscan2 256 COUNT 2
语法:HSET key field value [field value ...]
语法:HSETNX key field value
127.0.0.1:6379> HSETNX hsetnx 1 1 127.0.0.1:6379> HGETALL hsetnx 127.0.0.1:6379> HSETNX hsetnx 1 2 127.0.0.1:6379> HGETALL hsetnx
语法:HSTRLEN key field
127.0.0.1:6379> HSTRLEN hstrlen 1 127.0.0.1:6379> HSET hstrlen 1 123456 127.0.0.1:6379> HSTRLEN hstrlen 1
语法:HVALS key
127.0.0.1:6379> HVALS hvals 127.0.0.1:6379> HSET hvals 1 2 3 4 5 6 7 8 127.0.0.1:6379> HVALS hvals