DEL

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

Delete keys

Usage: del key [type]
Returns the number of deleted keys.
📍 type is one of string/list/set/zset/hash/stream.
      The type argument was added in ent811. Please use it.

Example

Command>set key1 Hello
Result>OK
Command>set key2 Redis
Result>OK
Command>set key3 Server
Result>OK
Command>del key1 string
Result>1
Command>del key2 key3 string
Result>2

View animation


Syntax

DEL key [key ...] [type]

  • Available since version 1.0.0.
  • Time complexity is O(N). N is the number of keys to delete.
  • ent811 type added.
SQL Delete If you have Redis Enterprise 7.3.0 or later, try DELETE.
Related commands EXISTS, LREM, SREM, ZREM, HDEL
Clients for Java Jedis, Lettuce, Redisson
Clients for C Hiredis

<< SETS DEL DELS >>

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