DEL

Redis Developer Course Redis Cloud Service Redis-Gate Server

Remove key

Remove the specified key.   Returns the number of deleted keys.
Usage is DEL key.

Return value

Integer reply: The number of keys that were removed.

Example

command>set key1 Hello
result>OK
command>set key2 Redis
result>OK
command>set key3 Server
result>OK
command>del key1
result>1
command>del key2 key3
result>2

Animation



Syntax

DEL key [key ...]

  • Available since 1.0.0.
  • Time complexity: O(N) where N is the number of keys that will be removed.
Related Commands EXISTS, LREM, SREM, ZREM, HDEL
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

To practice the command, click here to run Redis Web Client


<< SET DEL GET >>

Click for a question or to see comments.  Comments :     Viewed :

Email 답글이 올라오면 이메일로 알려드리겠습니다.