当前位置:网站首页>[redis] hash type
[redis] hash type
2022-06-29 01:58:00 【Riding a snail chasing a missile '】
List of articles
Hash type
Hash type , Also called hash , Its value It's an unordered Dictionary , Be similar to java Medium HashMap.
Compared with String Type serializes the object to Json character string , It is not very convenient to modify a field ; and Hash Structure can store each field in the object independently , You can do this for a single field CRUD:


The basic general commands are shown in the figure above , Here is a detailed introduction !
1.1 HSET & HGET & HMSET & HMGET

HSET key field value: Add or modify hash type key Of field ValueHGET key field: Get one hash type key Of field ValueHMSET: Batch add multiple hash type key Of field ValueHMGET: Get more than one in batch hash type key Of field Value

You can see Hash Type implements a further layer of structured storage

In batch processing, the attribute implementation for a single object is each field

1.2 HGETALL & HKEYS & HVALS

HGETALL: Get one hash Type of key All of them field and valueHKEYS: Get one hash Type of key All of them fieldHVALS: Get one hash Type of key All of them value

1.3 HINCRBY & HINCEBYFLOAT

HINCRBY: The number stored at the field in the hash stored at the increment key . If the key does not exist , A new key containing the hash will be created . If the field does not exist , Set the value to before performing the operation 0.HINCEBYFLOAT: In specified increments , The specified field stored at the key and representing the hash of the floating-point number increment. If the increment value is negative , The result is that the hash field value decreases , Not incremental . If one of the following occurs , Returns an error : This field contains a value of the wrong type ( It's not a string ); The current field content or the specified increment cannot be parsed as a double precision floating-point number .

1.4 HSETNX

Only if the field does not already exist , Will be stored in key to value The field in the hash at is set to . If the key does not exist , A new key containing the hash will be created . If the field already exists , Then this operation is invalid .
- 1 If the field is a new field in the hash and the value is set .
- If a field already exists in the hash and no action is taken , Then for 0.

1.5 HSTRLEN & HLEN

HSTRLEN: Get one hash Type of key The length of the medianHLEN: Get one hash Type of key All of them field Size

边栏推荐
- 7-29 delete substring in string (non KMP)
- Near consensus mechanism
- How does flush open an account? Is it safe to open an account online now?
- Battle drag method 1: moderately optimistic and build self-confidence (2)
- How to encrypt the device
- 利用kubernetes資源鎖完成自己的HA應用
- [apprendre la programmation FPGA - 49 à partir de zéro]: vision - Comment la puce a - t - elle été conçue?
- Understand flex layout in an article
- 如何成为一名高级数字 IC 设计工程师(6-7)数字 IC 验证篇:DEBUG 技巧
- The left toolbar of hbuilder is missing
猜你喜欢

SystemVerilog-结构体(一)

4276. good at C

【Redis】数据介绍 & 通用命令 & String类型

The left toolbar of hbuilder is missing

TiFlash 面向编译器的自动向量化加速
Scala 基础 (三):运算符和流程控制
![[high concurrency, high performance and high availability of massive data MySQL practice-10] - Implementation of mvcc in InnoDB](/img/dc/a30ccd9943e668aef8c874980a4975.jpg)
[high concurrency, high performance and high availability of massive data MySQL practice-10] - Implementation of mvcc in InnoDB
![[MySQL practice of high concurrency, high performance and high availability of massive data -9] - transaction concurrency control solutions lbcc and mvcc](/img/62/77c2274db4f92ad1d88901e149251c.jpg)
[MySQL practice of high concurrency, high performance and high availability of massive data -9] - transaction concurrency control solutions lbcc and mvcc

Stm32l4xx serial port log configuration analysis

Pat grade a real problem 1165
随机推荐
如何成为一名高级数字 IC 设计工程师(4-5)脚本篇:Shell 脚本实现的文件比较操作
[TS] as type assertion
Necessary technologies for chip manufacturers (1) Introduction
[TS] type alias
Magic Quadrant of motianlun's 2021 China Database
[solution] longest common subsequence
MySQL详解 --- 聚合与分组
[從零開始學習FPGA編程-49]:視野篇 - 芯片是如何被設計出來的?
Written examination questions, answers and analysis of Digital IC design and FPGA design (2) 2021 Huawei Hisilicon (Part 1)
【内网穿透】Frp 自建跳板-两个内网通讯上线-反弹shell
Typescript (7) generic
[understanding of opportunity -33]: seeing is not necessarily true. Most of the time, "seeing is false"
Kuboardv3与监控套件安装
如何成为一名高级数字 IC 设计工程师(4-2)脚本篇:Verilog HDL 代码实现的文件读写操作
Qt基础教程:QStringList
The left toolbar of hbuilder is missing
SystemVerilog-结构体(一)
Stm32l4xx serial port log configuration analysis
Who do you want to know when opening a stock account? Is it safe to open an account online now?
Callback function of unity after importing resources