当前位置:网站首页>[redis] list type
[redis] list type
2022-06-29 01:59:00 【Riding a snail chasing a missile '】
List of articles
List type
Redis Medium List The type and java Medium LinkedList similar , It can be regarded as a two-way linked list structure , It can support forward retrieval , Reverse retrieval is also supported .
characteristic :
- Orderly
- Elements can be repeated
- Insert and delete fast
- The query speed is average
Often used to store an ordered data , for example : Friends circle like 、 Comment list

The basic general commands are shown in the figure above , Here is a detailed introduction !
1.1 LPUSH & LPOP & RPUSH & RPOP


- LPUSH key element …: Insert one or more elements to the left of the list
- RPUSH key element …: Insert one or more elements to the right of the list

Add left 1、2、3, The actual order is 3、2、1; Add... To the right 4、5、6, The actual order is 4、5、6:

LPOP key: Remove and return the first element to the left of the list , No return nil
RPOP key: Remove and return the first element to the right of the list

Left side removal 3 Elements , Remove from the right 1 Elements , In the end 4、5 Two elements :

1.2 BLPOP & BRPOP

And LPOP、RPOP similar , Just wait for the specified time when there is no element , Not directly back nil( Block access )
As shown in the figure , We designate waiting user1 One hundred seconds , Add... In the new window user1 after , The original BLPOP The command has the result , And return the extracted element and the waiting time .

1.3 LRANGE

Returns all elements within a range of subscripts :

边栏推荐
- In MySQL database, the two data written when creating tables with foreign keys are the same. Do I copy them or fail to display them
- 牛客网——华为题库(41~50)
- Examen final de troisième année
- Dialogue with opensea co creation Alex: we still only touch the tip of the iceberg of NFT capability | chain catcher
- 【Redis】Key的层级结构
- SAP ui5 beginner tutorial Part 23 - sorting sort and grouping Group trial version of list control
- How does flush open an account? Is it safe to open an account online now?
- okcc呼叫中心的计费方式哪个最好
- 如何成为一名高级数字 IC 设计工程师(4-3)脚本篇:C 语言实现的文件读写操作
- How to choose source code encryption software
猜你喜欢

Kuboardv3 and monitoring kit installation

Adding, deleting, checking and modifying stack - dynamic memory
![[understanding of opportunity -33]: seeing is not necessarily true. Most of the time,](/img/60/703a5bc3038d28bcf812415032f240.jpg)
[understanding of opportunity -33]: seeing is not necessarily true. Most of the time, "seeing is false"

How to become a senior digital IC Design Engineer (4-5) script: file comparison operation implemented by shell script

4276. good at C

SystemVerilog-结构体(一)

【Redis】初识 Redis
![[机缘参悟-33]:眼见不一定为实,大多数时候“眼见为虚”](/img/60/703a5bc3038d28bcf812415032f240.jpg)
[机缘参悟-33]:眼见不一定为实,大多数时候“眼见为虚”

Research on VB multi-layer firewall technology - state detection

In simple terms, server intrusion prevention
随机推荐
Blog publishing test 3
How to encrypt the device
Digital IC design, FPGA design written examination questions, answers and analysis of autumn move (1) 2022 Ziguang zhanrui (Part 1)
[从零开始学习FPGA编程-49]:视野篇 - 芯片是如何被设计出来的?
PHP hospital network reservation management system source code, hospital consultation reservation registration OA system (commercial or graduation design)
[solution] longest common subsequence
okcc呼叫中心的计费方式哪个最好
Near consensus mechanism
Stm32l4xx serial port log configuration analysis
[C language] Fibonacci sequence and frog jumping steps (the most detailed elementary frog jumping steps)
芯片原厂必学技术(1)引言
Kuboardv3与监控套件安装
Test a CSDN free download software
Testing until you're 35? The 35 + test will lead to unemployment?
Scala 基礎 (三):運算符和流程控制
How to become a senior digital IC Design Engineer (4-5) script: file comparison operation implemented by shell script
Crawler exercise (IV) -- IP address problem
Utiliser kubernets Resource Lock pour compléter son application ha
Niuke.com Huawei question bank (41~50)
如何成为一名高级数字 IC 设计工程师(3-5)工具篇:SpyGlass 技术
