加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

缓存技术Redis之Hash类型详解

发布时间:2020-12-16 04:41:55 所属栏目:安全 来源:网络整理
导读:《缓存技术Redis之Hash类型详解》要点: 本文介绍了缓存技术Redis之Hash类型详解,希望对您有用。如果有疑问,可以联系我们。 简介 Hash是String类型的filed和value的映射表.更适合用来存储对象,相对于每个属性都存成String类型,将一个对象存储在hash类型中,

《缓存技术Redis之Hash类型详解》要点:
本文介绍了缓存技术Redis之Hash类型详解,希望对您有用。如果有疑问,可以联系我们。

简介

Hash是String类型的filed和value的映射表.更适合用来存储对象,相对于每个属性都存成String类型,将一个对象存储在hash类型中,更省内存并且便于存取.

办法

Hset 设置hash的filed为定值,如果key不存在则创立,如果存在则更新.Hset key filed value

缓存技术Redis之Hash类型详解

Hsetnx 设置hash的filed为定值,如果key不存在则创立返回1,如果存在也无法更新返回0. hsetnx key field value

缓存技术Redis之Hash类型详解

Hmset 同时设置hash的多个filed hmset key field value [field value ...]

Hmget 同时获取多个filed hmget key field [field ...]

缓存技术Redis之Hash类型详解

Hincrby 给filed加定值,但是必需是整数 hincrby key field increment

缓存技术Redis之Hash类型详解

Hexists 断定filed是否存在 hexists key field

缓存技术Redis之Hash类型详解

Hlen 返回hash的filed数目hlen key

缓存技术Redis之Hash类型详解

Hdel 删除了hash指定的filed hdel key field [field ...]

缓存技术Redis之Hash类型详解

Hkeys 返回hash所有的filed hkeys key

缓存技术Redis之Hash类型详解

hvals:返回hash的所有valuehvals key

缓存技术Redis之Hash类型详解

Hgetall 返回hash的所有filed以及value

缓存技术Redis之Hash类型详解

欢迎参与《缓存技术Redis之Hash类型详解》讨论,分享您的想法,编程之家PHP学院为您提供专业教程。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读