当前位置:网站首页>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.
边栏推荐
- mysql-. SQL file phishing Online
- 面试步骤的面试技巧
- GCC introduction
- 如临现场的视觉感染力,NBA决赛直播还能这样看?
- TiDB v6.0.0 (DMR) :缓存表初试丨TiDB Book Rush
- Scientific research - web of science retrieval skills
- 【sciter】: sciter-fs模块扫描文件API的使用及其注意细节
- soapui的菜鸟教程
- Using soapUI to obtain freemaker's FTL file template
- Day39 prototype chain and page Fireworks Effect 2021.10.13
猜你喜欢

Simple understanding of ThreadLocal

Using soapUI to obtain freemaker's FTL file template

科研丨Web of Science检索技巧

Characteristics of solar wireless LED display

Unity screenshot function

QML control type: tabbar

Day36 JS notes ecma6 syntax 2021.10.09

智联招聘基于 Nebula Graph 的推荐实践分享

Day29 JS notes 2021.09.23

Practice and Thinking on the architecture of a set of 100000 TPS im integrated message system
随机推荐
Jetpack Compose Desktop 桌面版本的打包和发布应用
What is DAPP system development and analytical understanding
董宇辉,新东方以及凤凰卫视
人人都可以参与开源!龙蜥社区最不容错过的开发者活动来了
关于Pytorch中双向LSTM的输出表示问题
行业分析| 快对讲,楼宇对讲
What method is required for word, PDF and txt files to realize full-text content retrieval?
使用logrotate对宝塔的网站日志进行自动切割
Recommended practice sharing of Zhilian recruitment based on Nebula graph
Use logrotate to automatically cut the website logs of the pagoda
day24 js笔记 2021.09.15
智联招聘基于 Nebula Graph 的推荐实践分享
Day37 JS note motion function 2021.10.11
Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush
Day29 JS notes 2021.09.23
setInterval、setTimeout和requestAnimationFrame
Splicing strings in the string collection_ Stream based
Dongyuhui, New Oriental and Phoenix Satellite TV
来吧元宇宙,果然这热度一时半会儿过不去了
Contract quantification system development (construction explanation) - contract quantification system development (source code analysis and ready-made cases)