当前位置:网站首页>Redis hash hash type string (5)
Redis hash hash type string (5)
2022-06-28 11:46:00 【Jiangxiaolong's technology blog】
1.redis Hash type operation
The hash type is mainly used for and mysql Table fields
When the hash type inserts different values of the same field , The new value overwrites the old value
2. Hash type common instructions
command | meaning | grammar |
HMSET | Set up a hash key | hmset key Field 1 value1 Field 2 value2 |
HMGET | see hash key | hmget key Field 1 value1 Field 2 value2 |
HMGETALL | see key All the values in | hmget key |
3. Create a hash key
grammar :hmset key Field 1 value1 Field 2 value2
127.0.0.1:6379> HMSET user username jiangxl age 99 job it
OK
- 1.
- 2.
4. Look at the hash key A field in
127.0.0.1:6379> HMGET user username
1) "jiangxl"
- 1.
- 2.
5. Look at the hash key All fields in
127.0.0.1:6379> HGETALL user
1) "username"
2) "jiangxl"
3) "age"
4) "99"
5) "job"
6) "it"
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
6. To the existing key Add the field
127.0.0.1:6379> HMSET user qy bj
OK
127.0.0.1:6379> HGETALL user
1) "username"
2) "jiangxl"
3) "age"
4) "99"
5) "job"
6) "it"
7) "qy"
8) "bj"
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
7. Insert Chinese field value
[[email protected] ~]# redis-cli hmset user qy Beijing
OK
[[email protected] ~]# redis-cli --raw hgetall user
username
jiangxl
age
27
job
hr
qy
Beijing
usernmae
xiaohong
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
边栏推荐
- Ali three sides: what is the difference between using on or where in the left join associated table and the condition
- 水果FL Studio/Cubase/Studio one音乐宿主软件对比
- 李宏毅《机器学习》丨7. Conclusion(总结)
- Recommended practice sharing of Zhilian recruitment based on Nebula graph
- 时间戳和date转换「建议收藏」
- 《运营之光3.0》全新上市——跨越时代,自我颠覆的诚意之作!
- This Exception was thrown from a job compiled with Burst, which has limited exception support. 报错
- 东方财富手机股票开户哪个券商更安全更方便?
- Thesis reading (59):keyword based diverse image retrieval with variable multiple instance graph
- What is DAPP system development and analytical understanding
猜你喜欢

day39 原型鏈及頁面烟花效果 2021.10.13

水果FL Studio/Cubase/Studio one音乐宿主软件对比

Simple understanding of ThreadLocal

Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system

一套十万级TPS的IM综合消息系统的架构实践与思考

Zero foundation self-study SQL course | if function

Jetpack Compose Desktop 桌面版本的打包和发布应用

Industry analysis - quick intercom, building intercom

2022中国信通院首届业务与应用安全发展论坛成功召开!

Packaging and publishing application of jetpack compose desktop version
随机推荐
Graduation season, some suggestions for you who are new to the society
第2章 还记得点、线、面吗(二)
100 important knowledge points that SQL must master: retrieving data
【无标题】虚拟机vmnet0找不到且报错:没有未桥接的主机网络适配器
Jetpack Compose Desktop 桌面版本的打包和发布应用
When an entity is converted to JSON, the field with null value is lost
Convert the file URL in the browser to a file stream
SQL必需掌握的100个重要知识点:检索数据
一套十万级TPS的IM综合消息系统的架构实践与思考
Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
It is safer for individuals to choose which securities company to open an account for buying floor funds
Apache2配置对目录拒绝访问,但是可以访问里面文件的设置
2022 open source software security status report: over 41% of enterprises do not have enough confidence in open source security
MySQL cannot query the maximum value using the max function
day23 js笔记 2021.09.14
What method is required for word, PDF and txt files to realize full-text content retrieval?
mysql-.sql文件钓鱼上线
2022中国信通院首届业务与应用安全发展论坛成功召开!
Redis6 一:Nosql引入、Redis可以解决什么问题?
来吧元宇宙,果然这热度一时半会儿过不去了