当前位置:网站首页>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>
边栏推荐
- mysql binlog 数据源配置文档麻烦分享一下
- Fabric ledger data block structure analysis (I): how to analyze the smart contract transaction data in the ledger
- Vs2017 add header file path method
- Write a positive integer to the node and return a floating-point number multiplied by 0.85 when reading the node
- R for Data Science (notes) -- data transformation (used by filter)
- Todesk remote control, detailed introduction and tutorial
- Apache+php+mysql environment construction is super detailed!!!
- Php OSS file read and write file, workerman Generate Temporary file and Output Browser Download
- 微信小程序轮播图怎么自定义光标位置
- Download steps of STM32 firmware library
猜你喜欢

Power efficiency test

Generate the last login user account report of the computer through SCCM SQL

试驾 Citus 11.0 beta(官方博客)

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

Apache+php+mysql environment construction is super detailed!!!

Mq-2 smoke concentration sensor (STM32F103)

Northwestern Polytechnic University attacked by hackers? Two factor authentication changes the situation!

Vs2017 setting function Chinese Notes

Starring develops httpjson access point + Database

一次 MySQL 误操作导致的事故,高可用都不顶不住!
随机推荐
What other data besides SHP data
微信小程序轮播图怎么自定义光标位置
Volcano成Spark默认batch调度器
Making startup U disk -- Chinese cabbage U disk startup disk making tool V5.1
Capacitive inching touch switch module control (stm32f103c8t6)
Todesk remote control, detailed introduction and tutorial
How to select the ECS type and what to consider?
Volcano becomes spark default batch scheduler
技术实现 | Apache Doris 冷热数据存储(一)
Application practice | massive data, second level analysis! Flink+doris build a real-time data warehouse scheme
Kubernetes cluster deployment
The cdc+mysql connector joins the date and time field from the dimension table by +8:00. Could you tell me which one is hosted by Alibaba cloud
Bytebase joins Alibaba cloud polardb open source database community
Module V
php OSS文件读取和写入文件,workerman生成临时文件并输出浏览器下载
cdc sql表里面的datetime要用什么类型替换
小白请教下各位大佬,cdc抽取mysql binlog是严格顺序的吗
特尔携手微软发挥边云协同势能,推动AI规模化部署
Multi cloud mode is not a "master key"
Generate the last login user account report of the computer through SCCM SQL