lrm
LRM
Apply for Redis Developer Course
|
Redis Regular Inspection / Technical Support
|
Redis Enterprise Server
|
|---|
Remove values by pattern
Usage is lrm key val*.
You can use a glob-style pattern for the value.
- * : Matches any characters: h*llo -> hllo, heeeello, etc
- ? : Matches one character: h?llo -> hallo, hello, hxllo, etc
- [alphabet] : Matches a character inside the brackets: h[ae]llo -> hallo, hello
- [^e] : Matches any character except those in the brackets:
h[^e]llo -> hallo, hbllo, ... but hello is excluded.
- [a-c] : Matches a character in the range: h[a-c]llo -> hallo, hbllo, hcllo
- \ : Prefix special characters (*?[^]) with \ to use them literally.
Example
| Command> | lpush mylist value11 value12 value21 value22 |
| Result> | 4 |
| Command> | lrm mylist value1* |
| Result> | 2 |
| Command> | lls mylist * |
| Result> |
1) value22 2) value21 |
Syntax
LRM key pattern
- Available since Enterprise version 6.0.0.
- Time complexity is O(N). N is the number of elements.
| << LREM | LRM | LTRIM >> |
|---|
Email
답글이 올라오면 이메일로 알려드리겠습니다.
