UNLINK
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.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Always | Integer: the number of keys removed | Integer |
Examples
Section titled “Examples”127.0.0.1:6379> SET cache:page "<html>...</html>"OK127.0.0.1:6379> UNLINK cache:page cache:other(integer) 1Compatibility
Section titled “Compatibility”Same reply as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.