取消链接

Syntax
UNLINK key [key ...]
Available since:
4.0.0
Time complexity:
O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of.
ACL categories:
@keyspace, @write, @fast,

这个命令与DEL非常相似:它删除指定的键。 就像DEL一样,如果键不存在,它会被忽略。然而,该命令 在不同的线程中执行实际的内存回收,因此它不会 阻塞,而DEL会阻塞。这就是命令名称的由来:该命令只是 取消链接键与键空间的关联。实际的删除 将在稍后异步进行。

示例

SET key1 "Hello" SET key2 "World" UNLINK key1 key2 key3

RESP2/RESP3 回复

Integer reply: the number of keys that were unlinked.
RATE THIS PAGE
Back to top ↑