DEL

Key
Since 1.0.0Complexity O(N), where N is the number of keys given; deleting a single large key (e.g. a Hash with millions of entries) is O(M) and blocks the main thread — use UNLINK instead.↑ ↓ to switch commands

Delete one or more keys; returns how many were actually removed

Syntax
DEL key [key ...]

Description

Deletes the specified keys. Keys that do not exist are ignored (and not counted in the return value). This is the most common way to delete keys — it wipes them from the keyspace entirely.

Return value

The number of keys deleted (0 means none of them existed).

Example
redis> SET key1 "Hello"
OK
redis> SET key2 "World"
OK
redis> DEL key1 key2 key3
(integer) 2

Notes