Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis DEL Command

Redis DEL Command

Redis Key

The Redis DEL command is used to remove an existing key. A key that does not exist is ignored.

Syntax

The basic syntax of the redis DEL command is as follows:



redis 127.0.0.1:6379> DEL KEY_NAME

Available Version

= 1.0.0

Return Value

The number of keys that were removed.

Example

First, we create a key in redis and set its value.



redis 127.0.0.1:6379> SET w3ckey redis

OK

Now we delete the created key.



redis 127.0.0.1:6379> DEL w3ckey

(integer) 1

Redis Key