当前位置:网站首页>redis中value/list
redis中value/list
2022-07-01 11:19:00 【每日一悟】
list:无环双向链表
redis key中有两个指针,head头指针,tail尾指针
lpush key value[value...]
lpush k1 abcdef ==> fedcba
rpush key value[value...]
rpush k1 abcdef ==> abcdef
lpop key
lpop k1 ==> f
rpop key
rpop k2 ==> f
栈:同向命令
队列:反向命令
lrange key start end
lrange k1 0 -1 ==> 返回k1中所有元素
lindex k1 -1 ==> 取出k1中最后一个元素
lset k1 3 y ==> 更新索引为3的元素,改为y
lrem k3 2 a ==> 从k3中移除两个a(从左往右)
lrem k3 -2 a ==> 从k3中移除两个a(从右往左)
linsert k3 after 6 a ==> 在k3中6后面添加a(如果有多个6,在第一6后面添加)
linsert k3 before 6 a ==> 在k3中6前面添加a
llen k3 ==> 统计k3中一共有多少元素
blpop key[key...] timeout
timeout:阻塞秒数,timeout=0时,会一直阻塞,直到未来里面有数据
ltrim key start end:将start end两端的数据进行移除,不包含所指的数,中间的东西是不会删的
边栏推荐
- 分享psd格式怎么预览的方法和psd文件缩略图插件[通俗易懂]
- 软件项目管理 9.2.软件项目配置管理过程
- Goldfish rhca memoirs: do447 uses ansible to communicate with API -- using ansible tower API to start jobs
- Applymiddleware principle
- Face detection and recognition system based on mtcnn+facenet
- 英特爾實驗室公布集成光子學研究新進展
- 放弃深圳高薪工作回老家
- Wechat applet development - user authorization to log in to "suggestions collection"
- No statements may be issued when any streaming result sets are open and in use on a given connection
- solo 可以通过 IPV6 访问吗?
猜你喜欢

华为设备配置大型网络WLAN基本业务

Tempest HDMI leak reception 4

華為設備配置大型網絡WLAN基本業務

Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)

CVPR22 |CMT:CNN和Transformer的高效结合(开源)

y48.第三章 Kubernetes从入门到精通 -- Pod的状态和探针(二一)

关于Keil编译程序出现“File has been changed outside the editor,reload?”的解决方法

CPI教程-异步接口创建及使用

Brief analysis of edgedb architecture

CVPR 2022 | self enhanced unpaired image defogging based on density and depth decomposition
随机推荐
商汤进入解禁期:核心管理层自愿禁售 强化公司长期价值信心
Tianrunyun, invested by Tian Suning, was listed: its market value was 2.2 billion Hong Kong, and its first year profit decreased by 75%
金融壹账通拟7月4日香港上市:2年亏近30亿 市值蒸发超90%
MIT's latest paper, "the need for interpretable features: motivation and classification": building interpretability in the constituent elements of machine learning models
Leetcode 181 Employees exceeding the manager's income (June 29, 2022)
Yoda unified data application -- Exploration and practice of fusion computing in ant risk scenarios
田溯宁投的天润云上市:市值22亿港元 年利润下降75%
提问:测试工程师应该具备哪些职业素养?
Harbor webhook从原理到构建
Ten years of sharpening a sword: unveiling the secrets of ant group's observability platform antmonitor
Web foundation of network security note 02
Nordic nrf52832 flash 下载M4错误
Ultra detailed black apple installation graphic tutorial sent to EFI configuration collection and system
印象深刻的bug汇总(持续更新)
Export and import of incluxdb on WIN platform
ES6 promise Usage Summary
Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)
证券账户随便哪里开都能使用吗 开户安全吗
京东与腾讯续签合作:向腾讯发行A类股 价值最高达2.2亿美元
Global filter (processing time format)