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.

UNLINK

Last updated
UNLINK key [key ...]
Group
Keys
Complexity
O(N) for N keys
Arity
-2 (at least 2 words, counting the command name)
Flags
write, fast
Keys
first 1, last final argument, step 1
HotKV Cloud
All plans
On-Premise
no license needed

UNLINK removes the given keys and returns how many of them existed. It gives the same result and the same keyspace events as DEL, so clients written for Redis that prefer UNLINK for large values work unchanged. Missing keys are ignored, and several keys are removed together.

Case RESP2 RESP3
Always Integer: the number of keys removed Integer
127.0.0.1:6379> SET cache:page "<html>...</html>"
OK
127.0.0.1:6379> UNLINK cache:page cache:other
(integer) 1

Same reply as Redis 7 and Valkey 8.

DEL, EXISTS