代潇瑞博客

rPushx 命令/方法/函数

Description

Adds the string value to the tail (right) of the list if the ist exists. FALSE in case of Failure.

添加一个VALUE到LIST容器的底部(右侧)如果这个LIST存在的话。


Parameters

key

value String, value to push in key


Return value

LONG The new length of the list in case of success, FALSE in case of Failure.

如果ADD成功, 返回LIST容器最新的长度。失败则返回FALSE。


Examples

$redis->delete('key1');

$redis->rPushx('key1', 'A'); // returns 0

$redis->rPush('key1', 'A'); // returns 1

$redis->rPushx('key1', 'B'); // returns 2

$redis->rPushx('key1', 'C'); // returns 3

/* key1 now points to the following list: [ 'A', 'B', 'C' ] */

【相关命令】

触屏版 | 电脑版

Copyright © 2013 代潇瑞博客手机版

QQ: 446673330

粤ICP备13071969号-1