redis hash operation

Hash operation
how to set hash
set one value at a time
hset userinfo name sfz
get one value at a time
hget userinfo age
get a specified field
hmget userinfo name age
set multiple values ​​at a time
hmset param id 10 name sfz age 12 address beijin
get all values
​​hgetall userinfo

delete field
hdel username name

Determine if
hexists userinfo name exists

hset increments by 1
hincrby userinfo age 1
hdecrby userinfo age 1
view the field
hkeys userinfo
view the number
hen userinfo
get all values
​​hvals userinfo

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325073214&siteId=291194637