summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/lpop.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:34:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:34:57 +0000
commitd71fd6264d58795c50b9350d7c39677b671e0896 (patch)
tree0aa9e0bd923a00b9ddda4e01af55a76ed314097c /iredis/data/commands/lpop.md
parentReleasing debian version 1.9.1-3. (diff)
downloadiredis-d71fd6264d58795c50b9350d7c39677b671e0896.tar.xz
iredis-d71fd6264d58795c50b9350d7c39677b671e0896.zip
Merging upstream version 1.9.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'iredis/data/commands/lpop.md')
-rw-r--r--iredis/data/commands/lpop.md21
1 files changed, 17 insertions, 4 deletions
diff --git a/iredis/data/commands/lpop.md b/iredis/data/commands/lpop.md
index 6049176..f870112 100644
--- a/iredis/data/commands/lpop.md
+++ b/iredis/data/commands/lpop.md
@@ -1,16 +1,29 @@
-Removes and returns the first element of the list stored at `key`.
+Removes and returns the first elements of the list stored at `key`.
+
+By default, the command pops a single element from the beginning of the list.
+When provided with the optional `count` argument, the reply will consist of up
+to `count` elements, depending on the list's length.
@return
+When called without the `count` argument:
+
@bulk-string-reply: the value of the first element, or `nil` when `key` does not
exist.
+When called with the `count` argument:
+
+@array-reply: list of popped elements, or `nil` when `key` does not exist.
+
+@history
+
+- `>= 6.2`: Added the `count` argument.
+
@examples
```cli
-RPUSH mylist "one"
-RPUSH mylist "two"
-RPUSH mylist "three"
+RPUSH mylist "one" "two" "three" "four" "five"
LPOP mylist
+LPOP mylist 2
LRANGE mylist 0 -1
```