当前位置:网站首页>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>
边栏推荐
- Information theory of popular science Shannon
- Saltstack state state file configuration instance
- Experience of MDM master data project implementation for manufacturing projects
- Starring develops httpjson access point + Database
- Confirm whether the host is a large terminal or a small terminal
- Xiaodi class massive data processing business short chain platform
- 【Go語言刷題篇】Go從0到入門4:切片的高級用法、初級複習與Map入門學習
- What are the functions of IBPs open source form designer?
- Obstacle avoidance sensor module (stm32f103c8t6)
- Apache+PHP+MySQL环境搭建超详细!!!
猜你喜欢

An accident caused by a MySQL misoperation cannot be withstood by High Availability!

Kubernetes cluster deployment

Kubernetes集群部署

Application practice | massive data, second level analysis! Flink+doris build a real-time data warehouse scheme

What is CNN (convolutional neural network)

Bytebase 加入阿裏雲 PolarDB 開源數據庫社區

Confirm whether the host is a large terminal or a small terminal

Volcano成Spark默认batch调度器

Some small requirements for SQL Engine for domestic database manufacturers

UART communication (STM32F103 library function)
随机推荐
SaltStack State状态文件配置实例
flink cdc全量读mysql老是报这个错怎么处理
试驾 Citus 11.0 beta(官方博客)
Redis error: -bash: redis cli: command not found
Instruction rearrangement concept
请教一个问题。adbhi支持保留一个ID最新100条数据库,类似这样的操作吗
What is CNN (convolutional neural network)
Bytebase 加入阿裏雲 PolarDB 開源數據庫社區
【Go語言刷題篇】Go從0到入門4:切片的高級用法、初級複習與Map入門學習
Zadig + cave Iast: let safety dissolve in continuous delivery
Vs2017 setting function Chinese Notes
Network security review office starts network security review on HowNet
Northwestern Polytechnic University attacked by hackers? Two factor authentication changes the situation!
Unityshader world coordinates do not change with the model
Ask a question. Adbhi supports the retention of 100 databases with the latest IDs. Is this an operation like this
我链接mysql 报这个错 是啥意思呀?
假如,程序员面试的时候说真话
The group offsets of the Kafka of the Flink SQL. If the specified groupid is not mentioned
Capacitive inching touch switch module control (stm32f103c8t6)
cdc sql表里面的datetime要用什么类型替换