Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

DEL

Last updated
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.

Case RESP2 RESP3
Always Integer: the number of keys that existed and were removed Integer
127.0.0.1:6379> MSET a 1 b 2
OK
127.0.0.1:6379> DEL a b missing
(integer) 2
127.0.0.1:6379> EXISTS a
(integer) 0

Same behaviour and reply as Redis 7 and Valkey 8.

UNLINK, EXISTS, GETDEL, EXPIRE