当前位置:网站首页>[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

边栏推荐
- How to become a senior digital IC Design Engineer (5-1) theory: clock technology, reset Technology
- Redis data migration (III)
- The left toolbar of hbuilder is missing
- 如何成为一名高级数字 IC 设计工程师(4-5)脚本篇:Shell 脚本实现的文件比较操作
- 利用kubernetes资源锁完成自己的HA应用
- I have summarized some experiences from the whole process of R & D platform splitting
- Introduction to super dongle scheme
- 0和1的歧义问题
- Who do you want to know when opening a stock account? Is it safe to open an account online now?
- 指南针手机股票开户哪个券商更安全更方便?
猜你喜欢

Tiflash compiler oriented automatic vectorization acceleration

Battle drag method 1: moderately optimistic and build self-confidence (2)

SAP ui5 beginner tutorial 22 - development and use of filter
![[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

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

Callback function of unity after importing resources

How to become a senior digital IC Design Engineer (4-3)

The left toolbar of hbuilder is missing

In simple terms, server intrusion prevention

Flex application: realize two rows and five columns of data, self-adaptive
随机推荐
How to become a senior digital IC Design Engineer (6-6) digital IC Verification: system level simulation
Near's storage stacking
数字 IC 设计、FPGA 设计秋招笔试题目、答案、解析(1)2022 紫光展锐(上)
Configurable FFT system design based on risc-v SOC (1) Introduction
同花顺究竟是如何开户?现在网上开户安全么?
Written examination questions, answers and analysis of Digital IC design and FPGA design (2) 2021 Huawei Hisilicon (Part 1)
如何成为一名高级数字 IC 设计工程师(6-5)数字 IC 验证篇:覆盖率收集
Analysis of parsing principle of OData metadata request response in SAP ui5 application
How to become a senior digital IC Design Engineer (3-5) tools: Spyglass Technology
为什么要在网站上安装SSL证书?
Business system anti-virus
RISC CPU design based on FPGA (4) 36 questions about the project and their answers
Scala 基礎 (三):運算符和流程控制
Fibonacci sequence
Noip2006-2018 improvement group preliminary test questions improvement procedure questions csp-s 2019 2020 preliminary test questions improvement procedure questions
PR FAQ: how to retrieve accidentally deleted video and audio in PR?
[learn FPGA programming from scratch -49]: Vision - how is the chip designed?
Understand flex layout in an article
如何成为一名高级数字 IC 设计工程师(5-1)理论篇:时钟技术、复位技术
Analysis of advantages and disadvantages of environment encryption and transparent encryption