当前位置:网站首页>Get to know the data structure of redis - hash
Get to know the data structure of redis - hash
2022-06-24 19:52:00 【just_ peanut】
Redis Five data types commonly used in :
1、 character string (String)
2、 String list (List)
3、 Ordered string collection (Sorted list)
4、 Hash (Hash)
5、 String collection (Set)
One 、 Store hash (Hash) Common commands
a. assignment hset/hmset
b, Value hget/hmget/hgetall
c. Delete hdel
d. add number hincrby
e. Self study order hexists/hlen/hkeys/hvals
127.0.0.1:6379> hset myhash username hwm
(integer) 1
127.0.0.1:6379> hset muhash age 18
(integer) 1
127.0.0.1:6379> hmset muhash2 username zwy age 21
OK
127.0.0.1:6379> hget myhash username
"hwm"
127.0.0.1:6379> hmget myhash username age
1) "hwm"
2) "12"
127.0.0.1:6379> hgetall myhash
1) "username"
2) "hwm"
3) "age"
4) "12"
127.0.0.1:6379> hdel muhash2 username age
(integer) 2
127.0.0.1:6379> hgetall muhash2
(empty array)
127.0.0.1:6379> hset myhash2 username hwm
(integer) 1
127.0.0.1:6379> del myhash2
(integer) 1
127.0.0.1:6379> hget myhash2 username
(nil)
127.0.0.1:6379> hget myhash age
"12"
127.0.0.1:6379> hincrby myhash age 5
(integer) 17
127.0.0.1:6379> hget myhash age
"17"
127.0.0.1:6379> hgetall myhash
1) "username"
2) "hwm"
3) "age"
4) "17"
127.0.0.1:6379> hexists myhash age
(integer) 1
127.0.0.1:6379> hlen myhash
(integer) 2
127.0.0.1:6379> hkeys myhash
1) "username"
2) "age"
127.0.0.1:6379> hvals myhash
1) "hwm"
2) "17"
127.0.0.1:6379>
边栏推荐
- 【Go語言刷題篇】Go從0到入門4:切片的高級用法、初級複習與Map入門學習
- Vs2017 add header file path method
- Ls common parameters
- Internet of things? Come and see Arduino on the cloud
- Would you like to ask whether the same multiple tasks of the PgSQL CDC account will have an impact? I now have only one of the three tasks
- Development of NFT dual currency pledge liquidity mining system
- Xiaodi class massive data processing business short chain platform
- IP address to integer
- NFT双币质押流动性挖矿系统开发
- 目前是不是只cdc 监控mysql 可以拿到新增列的数据 sqlserver不行是吧
猜你喜欢

60 divine vs Code plug-ins!!

Kubernetes集群部署

Vs2017 setting function Chinese Notes
![[go Language brossage] go from 0 to Getting started 4: Advanced use of slice, Primary Review and Map Getting started Learning](/img/3a/db240deb4c66b219ef86f40d4c7b7d.png)
[go Language brossage] go from 0 to Getting started 4: Advanced use of slice, Primary Review and Map Getting started Learning

php OSS文件读取和写入文件,workerman生成临时文件并输出浏览器下载

Zadig + cave Iast: let safety dissolve in continuous delivery

Audio and video 2020 2021 2022 basic operation and parameter setting graphic tutorial

Starring V6 platform development take out point process

工作6年,月薪3W,1名PM的奋斗史

一次 MySQL 误操作导致的事故,高可用都不顶不住!
随机推荐
The difference between the lazy man mode and the hungry man mode
To open the registry
Xiaodi class massive data processing business short chain platform
Apache+php+mysql environment construction is super detailed!!!
Zadig + cave Iast: let safety dissolve in continuous delivery
R language 4.1.0 software installation package and installation tutorial
Kubernetes集群部署
60 个神级 VS Code 插件!!
对国产数据库厂商提几个关于SQL引擎的小需求
Unity mobile game performance optimization spectrum CPU time-consuming optimization divided by engine modules
假如,程序员面试的时候说真话
Some small requirements for SQL Engine for domestic database manufacturers
Mq-2 smoke concentration sensor (STM32F103)
PHP OSS file reads and writes files, and workman generates temporary files and outputs them to the browser for download
What do I mean when I link Mysql to report this error?
Microsoft Office Excel 2013 2016 graphic tutorial on how to enable macro function
Camera module and hardware interface of Camera1 camera
What is CNN (convolutional neural network)
全链路业务追踪落地实践方案
[computer talk club] Lecture 3: how to raise key issues?