Redis Lrange 命令

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

Redis Lrange 返回列表中指定区间内的元素,区间以偏移量 START 和 END 指定。 其中 0 表示列表的第一个元素, 1 表示列表的第二个元素,以此类推。 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推。

语法

redis 127.0.0.1:6379> LRANGE KEY_NAME START END

返回值

一个列表,包含指定区间内的元素。

实例

redis> RPUSH mylist "one"
(integer) 1
redis> RPUSH mylist "two"
(integer) 2
redis> RPUSH mylist "three"
(integer) 3
redis> LRANGE mylist 0 0
1) "one"
redis> LRANGE mylist -3 2
1) "one"
2) "two"
3) "three"
redis> LRANGE mylist -100 100
1) "one"
2) "two"
3) "three"
redis> LRANGE mylist 5 10
(empty list or set)
redis> 

查看更多 Redis 列表(List)命令

JavaScript & jQuery

JavaScript & jQuery

David Sawyer McFarland / O Reilly / 2011-10-28 / USD 39.99

You don't need programming experience to add interactive and visual effects to your web pages with JavaScript. This Missing Manual shows you how the jQuery library makes JavaScript programming fun, ea......一起来看看 《JavaScript & jQuery》 这本书的介绍吧!

XML、JSON 在线转换

XML、JSON 在线转换

在线XML、JSON转换工具

XML 在线格式化

XML 在线格式化

在线 XML 格式化压缩工具

UNIX 时间戳转换

UNIX 时间戳转换

UNIX 时间戳转换