Redis - Keys Del 命令



Redis DEL 命令用於刪除 Redis 中現有的鍵。

返回值

已刪除的鍵的數量。

語法

以下是 Redis DEL 命令的基本語法。

redis 127.0.0.1:6379> DEL KEY_NAME 

示例

首先,在 Redis 中建立一個鍵,並設定一些值。

redis 127.0.0.1:6379> SET tutorialspoint redis 
OK

現在,刪除之前建立的鍵。

redis 127.0.0.1:6379> DEL tutorialspoint 
(integer) 1
redis_keys.htm
廣告