当前位置:网站首页>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>
边栏推荐
- Eureka source code shallow reading - automatic fault removal
- [go language questions] go from 0 to entry 4: advanced usage of slice, elementary review and introduction to map
- Does version 2.2.0 support dynamic addition of MySQL synchronization tables
- If the programmer tells the truth during the interview
- Buddha bless you that there will never be a bug
- The efficiency of okcc call center data operation
- SaltStack State状态文件配置实例
- BSS应用程序云原生部署的8大挑战
- 一次 MySQL 误操作导致的事故,高可用都不顶不住!
- Fabric ledger data block structure analysis (I): how to analyze the smart contract transaction data in the ledger
猜你喜欢
Docker installing Oracle
Drawing DEM with GEE gracefully
UART communication (STM32F103 library function)
[R tidyverse] use of select verb
Five day summary of software testing
To open the registry
Vs2017 setting function Chinese Notes
Two solutions to the problem of 0xv0000225 unable to start the computer
Vs2017 add header file path method
Module V
随机推荐
[computer talk club] Lecture 3: how to raise key issues?
对国产数据库厂商提几个关于SQL引擎的小需求
Mq-2 smoke concentration sensor (STM32F103)
Two solutions to the problem of 0xv0000225 unable to start the computer
IP address to integer
请教一个问题。adbhi支持保留一个ID最新100条数据库,类似这样的操作吗
MySQL binlog data source configuration document, please share
【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习
LCD1602 string display (STM32F103)
R语言corrplot相关热图美化实例分析
Obstacle avoidance sensor module (stm32f103c8t6)
Using dynamic time warping (DTW) to solve the similarity measurement of time series and the similarity identification analysis of pollution concentration in upstream and downstream rivers
The difference between the lazy man mode and the hungry man mode
Why is the executor thread pool framework introduced
NFT pledge liquidity mining system development technology
SaltStack State状态文件配置实例
60 divine vs Code plug-ins!!
The group offsets of the Kafka of the Flink SQL. If the specified groupid is not mentioned
Win7 10 tips for installing Office2010 five solutions for installing MSXML components
Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优