当前位置:网站首页>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两端的数据进行移除,不包含所指的数,中间的东西是不会删的
边栏推荐
- Activity workflow engine
- Nordic nrf52832 flash download M4 error
- 8 best practices to protect your IAC security!
- node版本管理器nvm安装及切换
- Packet mode and three streaming modes in SDP protocol
- Mingchuang plans to be listed on July 13: the highest issue price is HK $22.1, and the net profit in a single quarter decreases by 19%
- [buuctf.reverse] 144_ [xman2018 qualifying]easyvm
- TEMPEST HDMI泄漏接收 4
- BAIC bluevale: performance under pressure, extremely difficult period
- Can I open a securities account anywhere? Is it safe to open an account
猜你喜欢
The project bar on the left side of CodeBlocks disappears, workspace automatically saves the project, default workspace, open the last workspace, workspace (Graphic tutorial, solved)
The first anniversary of the data security law, which four major changes are coming?
妙啊!MarkBERT
Tempest HDMI leak receive 5
Introduction to unittest framework and the first demo
Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)
我国蜂窝物联网用户已达 15.9 亿,年内有望超越移动电话用户
达梦数据冲刺科创板:拟募资24亿 冯裕才曾为华科教授
2022/6/28学习总结
商汤进入解禁期:核心管理层自愿禁售 强化公司长期价值信心
随机推荐
TEMPEST HDMI泄漏接收 5
今天开户今天能买股票吗?在线开户是很安全么?
软件项目管理 9.2.软件项目配置管理过程
Yoda unified data application -- Exploration and practice of fusion computing in ant risk scenarios
Win平台下influxDB导出、导入
【AI资讯月刊】350+资源大盘点!6月不容错过的资料和动态,都都都在这里啦!<附下载>
Technology sharing | introduction to linkis parameters
TMUX usage
证券账户销户后果 开户安全吗
树莓派4B安装tensorflow2.0[通俗易懂]
索引失效的几种情况
LeetCode. One question of the day: offer II 091 Paint the house (DP problem)
Spam filtering challenges
2022/6/28学习总结
In June 2022, it was the first programming language?!
solo 可以通过 IPV6 访问吗?
What are the advantages and disadvantages of PHP
How to realize the four isolation levels of MySQL (brief)
Are the consequences of securities account cancellation safe
银行卡借给别人是否构成犯罪