hash对象的一些常用命令
此hash指的是value是一个hash表(field-value是一组键值对)
> help hset
HSET key field value
summary: Set the string value of a hash field
设置hash键值对字段
> help hmset
HMSET key field value [field value ...]
summary: Set multiple hash fields to multiple values
同时设置多个键值对
> help hget
HGET key field
summary: Get the value of a hash field
从key对应的hash获取field对应的值
> help hmget
HMGET key field [field ...]
summary: Get the values of all the given hash fields
取出此hash中多个field对应的值。
> help hvals
HVALS key
summary: Get all the values in a hash
取出hash中所有的值
> help hgetall
HGETALL key
summary: Get all the fields and values in a hash
取出hash中所有的键值对
> help hlen
HLEN key
summary: Get the number of fields in a hash
hash表中有多少个字段
> help hdel
HDEL key field [field ...]
summary: Delete one or more hash fields
删除一个或多个hash字段
> help HINCRBYFLOAT
HINCRBYFLOAT key field increment
summary: Increment the float value of a hash field by the given amount
给hash的字段值加上指定浮点值。
这篇博客介绍了Redis中Hash对象的常用命令,包括设置和获取field-value键值对,查询多个值,获取所有键值对,计数字段数量以及更新字段值等操作。
646

被折叠的 条评论
为什么被折叠?



