当前位置:网站首页>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两端的数据进行移除,不包含所指的数,中间的东西是不会删的
边栏推荐
- 今天开户今天能买股票吗?在线开户是很安全么?
- 持续交付-Pipeline入门
- Ten years of sharpening a sword: unveiling the secrets of ant group's observability platform antmonitor
- Mutual conversion of pictures in fluent uint8list format and pictures in file format
- 软件项目管理 9.2.软件项目配置管理过程
- 商汤进入解禁期:核心管理层自愿禁售 强化公司长期价值信心
- JS日期格式化转换方法
- 关于Keil编译程序出现“File has been changed outside the editor,reload?”的解决方法
- How to make the development of liquidity pledge mining system, case analysis and source code of DAPP defi NFT LP liquidity pledge mining system development
- Oneconnect plans to be listed in Hong Kong on July 4: a loss of nearly 3 billion in two years, with a market capitalization evaporation of more than 90%
猜你喜欢

Value 1000 graduation project campus information publishing platform website source code

【MAUI】为 Label、Image 等控件添加点击事件

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

Unittest框架中跳过要执行的测试用例

2022/6/28学习总结

Huawei Equipment configure les services de base du réseau WLAN à grande échelle

英特爾實驗室公布集成光子學研究新進展

妙啊!MarkBERT

商汤进入解禁期:核心管理层自愿禁售 强化公司长期价值信心

TEMPEST HDMI泄漏接收 3
随机推荐
CANN算子:利用迭代器高效实现Tensor数据切割分块处理
YoDA统一数据应用——融合计算在蚂蚁风险场景下的探索与实践
tmux使用
Google's new paper Minerva: solving quantitative reasoning problems with language models
Wechat applet development - user authorization to log in to "suggestions collection"
Graduation season · advanced technology er
树莓派4B安装tensorflow2.0[通俗易懂]
我国蜂窝物联网用户已达 15.9 亿,年内有望超越移动电话用户
为什么一定要从DevOps走向BizDevOps?
Tempest HDMI leak receive 5
Unittest框架中跳过要执行的测试用例
超详细黑苹果安装图文教程送EFI配置合集及系统
Get key code
【AI资讯月刊】350+资源大盘点!6月不容错过的资料和动态,都都都在这里啦!<附下载>
金鱼哥RHCA回忆录:DO447使用Ansible与API通信--使用Ansible Tower API启动作业
Combination of Oracle and JSON
Can I open a securities account anywhere? Is it safe to open an account
kubernetes之ingress探索实践
solo 可以通过 IPV6 访问吗?
Width and widthstep of iplimage