《缓存技术Redis之Hash类型详解》要点:
本文介绍了缓存技术Redis之Hash类型详解,希望对您有用。如果有疑问,可以联系我们。
			           
简介
Hash是String类型的filed和value的映射表.更适合用来存储对象,相对于每个属性都存成String类型,将一个对象存储在hash类型中,更省内存并且便于存取.
办法
Hset 设置hash的filed为定值,如果key不存在则创立,如果存在则更新.Hset key filed value

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

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

Hincrby 给filed加定值,但是必需是整数 hincrby key field increment
Hexists 断定filed是否存在 hexists key field

Hlen 返回hash的filed数目hlen key

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

Hkeys 返回hash所有的filed hkeys key

hvals:返回hash的所有valuehvals key

Hgetall 返回hash的所有filed以及value

欢迎参与《缓存技术Redis之Hash类型详解》讨论,分享您的想法,维易PHP学院为您提供专业教程。
转载请注明本页网址:
http://www.vephp.com/jiaocheng/9262.html