Redis中hash常用命令

1、hset key field value 在key中添加一个键值对 field代表map中的key而这里可以把key看成mapRedis中hash常用命令
2、hget key field 通过hash 中的key h1获得对应的value值Redis中hash常用命令
3、hgetall key 获取所有hash中key值Redis中hash常用命令
4、hlen key 获取hash中键值对个数(value不是nil的情况下)Redis中hash常用命令
5、hkeys key 获取hash中的所有的keyRedis中hash常用命令
6、hvals key 获取hash中所有的value值Redis中hash常用命令
7、hexists key field 判断hash中是否包含h1这个key(返回1是包含0是不包含)Redis中hash常用命令
8、hdel key field field field … 删除hash中的key可以有多个返回数字几就删除了几个Redis中hash常用命令
9、hincrby key field increment 给hash中的key h1 添加数字(必须h1的value也是整数)Redis中hash常用命令
10、hincrbyfloat key field increment 给hash中的key h1 的value添加小数Redis中hash常用命令

11、hmget key field field … 获取hash对应的key的valueRedis中hash常用命令
12、hmset key field value field value … 设置hash中的key-value键值对Redis中hash常用命令
13、hsetnx key field value 给hash中设置键值对(key不能重复否则返回0)Redis中hash常用命令

相关文章:

  • 2022-12-23
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-04-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2020-03-25
  • 2021-10-24
  • 2021-09-07
  • 2022-01-22
  • 2021-11-07
相关资源
相似解决方案