Skip to content

Commit c6a510a

Browse files
committed
Fixed documentation for LPUSH, RPUSH.
1 parent 2fd9cc5 commit c6a510a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

README.markdown

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,14 @@ Adds the string value to the head (left) of the list. Creates the list if the ke
196196
*key*
197197
*value* String, value to push in key
198198
##### Return value
199-
*BOOL* `TRUE` in case of success, `FALSE` in case of Failure.
199+
*LONG* The new length of the list in case of success, `FALSE` in case of Failure.
200200
##### Examples
201201
<pre>
202-
$redis->lPush('key1', 'C');
203-
$redis->lPush('key1', 'B');
204-
$redis->lPush('key1', 'A'); /* key1 => [ 'A', 'B', 'C' ] */
202+
$redis->delete('key1');
203+
$redis->lPush('key1', 'C'); // returns 1
204+
$redis->lPush('key1', 'B'); // returns 2
205+
$redis->lPush('key1', 'A'); // returns 3
206+
/* key1 now points to the following list: [ 'A', 'B', 'C' ] */
205207
</pre>
206208

207209
## rPush
@@ -211,12 +213,14 @@ Adds the string value to the tail (right) of the list. Creates the list if the k
211213
*key*
212214
*value* String, value to push in key
213215
##### Return value
214-
*BOOL* `TRUE` in case of success, `FALSE` in case of Failure.
216+
*LONG* The new length of the list in case of success, `FALSE` in case of Failure.
215217
##### Examples
216218
<pre>
217-
$redis->rPush('key1', 'A');
218-
$redis->rPush('key1', 'B');
219-
$redis->rPush('key1', 'C'); /* key1 => [ 'A', 'B', 'C' ] */
219+
$redis->delete('key1');
220+
$redis->rPush('key1', 'A'); // returns 1
221+
$redis->rPush('key1', 'B'); // returns 2
222+
$redis->rPush('key1', 'C'); // returns 3
223+
/* key1 now points to the following list: [ 'A', 'B', 'C' ] */
220224
</pre>
221225

222226
## lPop

0 commit comments

Comments
 (0)