DEL

Syntax

  1. DEL key [key ...]

Time complexity: O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1).

Removes the specified keys. A key is ignored if it does not exist.

Return

Integer reply: The number of keys that were removed.

Examples

  1. dragonfly> SET key1 "Hello"
  2. "OK"
  3. dragonfly> SET key2 "World"
  4. "OK"
  5. dragonfly> DEL key1 key2 key3
  6. (integer) 2