redis命令参考(五) Hashes
哈希表
Hashes are maps between string fields and string values, so they are the perfect data type to represent objects (eg: A User with a number of fields like name, surname, age, and so forth):
一、HSET
二、HGET
三、HGETALL
> hset jimliang age 20 (integer) 1 > hset jimliang experience 4year (integer) 1 > hset jimliang email jimzyliang@wula.com (integer) 1 > hgetall jimliang 1) "age" 2) "20" 3) "experience" 4) "4year" 5) "email" 6) "jimzyliang@wula.com"
四、HINCRBY
五、HDEL
> hincrby jimliang age 5 //自增5个,是原子操作哦,即更改时会锁定 (integer) 25 > hget jimliang age "25" > hdel jimliang age //删除 哈希表jimliang中的 age 属性 (integer) 1 > hget jimliang age (nil)
1、以专家为榜样,不必自己重新探索
2、解构技能,找出实现80%效果的那20%
3、不要一心二用
4、练习练习再练习!然后获得即时反馈
5、坚持,不要在低谷期放弃
2、解构技能,找出实现80%效果的那20%
3、不要一心二用
4、练习练习再练习!然后获得即时反馈
5、坚持,不要在低谷期放弃