UNLINK

Since 1.1.0Keys

Syntax

UNLINK key [key ...]
  • Flags: fast, write
  • ACL categories: @fast, @generic, @keyspace, @write
  • Arity: -2

Deletes the given keys, like DEL, but frees large values in the background.

A value that takes more than 64 units of work to free goes to a background thread; the key is gone at once either way. A unit is a list, set, sorted-set or hash element, a JSON field, a stream node, a time series sample. Strings are always freed at once. INFO counts what is freed this way in lazyfree_pending_objects and lazyfreed_objects.

Background freeing is new in 1.1.1. In 1.1.0, UNLINK was the same as DEL.

Reply

  • The number of keys deleted.

Examples

> SET a 1
OK
> UNLINK a missing
(integer) 1