X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/a4460ef43f9625e6c09cdc327614d1b47c043489..12ebe2ac17a26ecf263f90b2acdf03db29b00223:/doc/LtrimCommand.html diff --git a/doc/LtrimCommand.html b/doc/LtrimCommand.html index a492fccb..08d3231a 100644 --- a/doc/LtrimCommand.html +++ b/doc/LtrimCommand.html @@ -16,7 +16,7 @@
-LtrimCommand: Contents
  LTRIM _key_ _start_ _end_
    Return value
    See also +LtrimCommand: Contents
  LTRIM _key_ _start_ _end_
    Return value

LtrimCommand

@@ -26,7 +26,7 @@
-

LTRIM _key_ _start_ _end_

+ #sidebar ListCommandsSidebar

LTRIM _key_ _start_ _end_

Time complexity: O(n) (with n being len of list - len of range)
Trim an existing list so that it will contain only the specifiedrange of elements specified. Start and end are zero-based indexes.0 is the first element of the list (the list head), 1 the next elementand so on.
For example LTRIM foobar 0 2 will modify the list stored at foobarkey so that only the first three elements of the list will remain.
_start_ and end can also be negative numbers indicating offsetsfrom the end of the list. For example -1 is the last element ofthe list, -2 the penultimate element and so on.
@@ -36,8 +36,8 @@ LPUSH mylist <someelement> LTRIM mylist 0 99
The above two commands will push elements in the list taking care thatthe list will not grow without limits. This is very useful when usingRedis to store logs for example. It is important to note that when usedin this way LTRIM is an O(1) operation because in the average casejust one element is removed from the tail of the list.
-

Return value

Status code reply

See also

- +

Return value

Status code reply +