DEL
DEL key [key ...]
- Group
- Keys
- Complexity
- O(N) for N keys, plus the size of each value removed
- Arity
- -2 (at least 2 words, counting the command name)
- Flags
- write
- Keys
- first 1, last final argument, step 1
- HotKV Cloud
- All plans
- On-Premise
- no license needed
DEL removes the given keys, whatever type of value they hold. Keys that do
not exist are ignored. When you pass several keys they are removed together:
no other client sees some of them deleted and others still present.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Integer: the number of keys that existed and were removed | Integer |
Examples
Section titled “Examples”127.0.0.1:6379> MSET a 1 b 2OK127.0.0.1:6379> DEL a b missing(integer) 2127.0.0.1:6379> EXISTS a(integer) 0Compatibility
Section titled “Compatibility”Same behaviour and reply as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.