DEL

AttentionThis page documents an earlier version. Go to the latest (v2.1)version.

Early Releases: Single-key request only. Requests with multiple keys are not yet supported.

Synopsis

DEL keyThis command deletes the given key.

  • If the key does not exist, it is ignored and not counted toward the total number of removed keys.

Return Value

Returns number of keys that were removed.

Examples

You can do this as shown below.

  1. $ SET yuga1 "America"
  1. "OK"
  1. $ SET yuga2 "Africa"
  1. "OK"
  1. $ DEL yuga1
  1. 1
  1. $ DEL not_a_key
  1. 0
  1. $ DEL yuga1 yuga2
  1. "ERR del: Wrong number of arguments"

See Also

exists, flushall, flushdb, get, getrange, hdel, hexists, hget, hset, hincrby, sadd, set