Redis Rpush 命令

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

Redis Rpush 命令用于将一个或多个值插入到列表的尾部(最右边)。

如果列表不存在,一个空列表会被创建并执行 RPUSH 操作。 当列表存在但不是列表类型时,返回一个错误。

注意:在 Redis 2.4 版本以前的 RPUSH 命令,都只接受单个 value 值。

语法

redis 127.0.0.1:6379> RPUSH KEY_NAME VALUE1..VALUEN

返回值

执行 RPUSH 操作后,列表的长度。

实例

redis 127.0.0.1:6379> RPUSH mylist "hello"
(integer) 1
redis 127.0.0.1:6379> RPUSH mylist "foo"
(integer) 2
redis 127.0.0.1:6379> RPUSH mylist "bar"
(integer) 3
redis 127.0.0.1:6379> LRANGE mylist 0 -1
1) "hello"
2) "foo"
3) "bar"

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

Java Message Service API Tutorial and Reference

Java Message Service API Tutorial and Reference

Hapner, Mark; Burridge, Rich; Sharma, Rahul / 2002-2 / $ 56.49

Java Message Service (JMS) represents a powerful solution for communicating between Java enterprise applications, software components, and legacy systems. In this authoritative tutorial and comprehens......一起来看看 《Java Message Service API Tutorial and Reference》 这本书的介绍吧!

JSON 在线解析

JSON 在线解析

在线 JSON 格式化工具

图片转BASE64编码

图片转BASE64编码

在线图片转Base64编码工具

正则表达式在线测试

正则表达式在线测试

正则表达式在线测试