Added documentation for the LTRIM command

This commit is contained in:
Seoester 2019-03-26 16:28:24 +01:00
parent 8ceb77e66a
commit 7c5bf53209
2 changed files with 26 additions and 0 deletions

View File

@ -200,6 +200,11 @@
"group": "List",
"readonly": true
},
"LTRIM": {
"arguments": "key start stop",
"group": "List",
"readonly": false
},
"LTTL": {
"arguments": "key",
"group": "List",

View File

@ -75,6 +75,7 @@ Most of the Ledisdb's commands are the same as Redis's, you can see the redis co
- [LMCLEAR key [key ...]](#lmclear-key-key-)
- [LEXPIRE key seconds](#lexpire-key-seconds)
- [LEXPIREAT key timestamp](#lexpireat-key-timestamp)
- [LTRIM key start stop](#ltrim-key-start-stop)
- [LTTL key](#lttl-key)
- [LPERSIST key](#lpersist-key)
- [LDUMP key](#ldump-key)
@ -1215,6 +1216,26 @@ ledis> LTTL a
ledis>
```
### LTRIM key start stop
Trims the list stored at key. Only the elements in the specified range [start, stop] remain.
**Return value**
Simple string reply: OK or error msg.
**Examples**
```
ledis> RPUSH a 1 2 3 4 5
(integer) 1
ledis> LTRIM a 2 -1
OK
ledis> LRANGE a 0 -1
1) "3"
2) "4"
3) "5"
```
### LTTL key
Returns the remaining time to live of a key that has a timeout. If the key was not set a timeout, `-1` returns.