Redis 列表(List)命令

更新时间: 2019-07-07 15:54

下表列出了列表相关的基本命令:

序号 命令 描述
1 Redis Blpop 命令 移出并获取列表的第一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。
2 Redis Brpop 命令 移出并获取列表的最后一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。
3 Redis Brpoplpush 命令 从列表中弹出一个值,将弹出的元素插入到另外一个列表中并返回它; 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止。
4 Redis Lindex 命令 通过索引获取列表中的元素
5 Redis Linsert 命令 在列表的元素前或者后插入元素
6 Redis Llen 命令 获取列表长度
7 Redis Lpop 命令 移出并获取列表的第一个元素
8 Redis Lpush 命令 将一个或多个值插入到列表头部
9 Redis Lpushx 命令 将一个值插入到已存在的列表头部
10 Redis Lrange 命令 获取列表指定范围内的元素
11 Redis Lrem 命令 移除列表元素
12 Redis Lset 命令 通过索引设置列表元素的值
13 Redis Ltrim 命令 对一个列表进行修剪(trim),就是说,让列表只保留指定区间内的元素,不在指定区间之内的元素都将被删除。
14 Redis Rpop 命令 移除列表的最后一个元素,返回值为移除的元素。
15 Redis Rpoplpush 命令 移除列表的最后一个元素,并将该元素添加到另一个列表并返回
16 Redis Rpush 命令 在列表中添加一个或多个值
17 Redis Rpushx 命令 为已存在的列表添加值

更多命令请参考:Redis 命令

The Art of Computer Programming, Volumes 1-3 Boxed Set

The Art of Computer Programming, Volumes 1-3 Boxed Set

Donald E. Knuth / Addison-Wesley Professional / 1998-10-15 / USD 199.99

This multivolume work is widely recognized as the definitive description of classical computer science. The first three volumes have for decades been an invaluable resource in programming theory and p......一起来看看 《The Art of Computer Programming, Volumes 1-3 Boxed Set》 这本书的介绍吧!

Markdown 在线编辑器

Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具

RGB CMYK 转换工具

RGB CMYK 互转工具

HEX HSV 转换工具

HEX HSV 转换工具

HEX HSV 互换工具