修改本页

Redis 命令 客户端 文档 社区 下载 问题 支持 许可

DEL key [key …]

相关命令

始于1.0.0.可用

时间复杂度:O(N), N 为被删除的 key 的数量。删除单个字符串类型的 key ,时间复杂度为O(1)。删除单个列表、集合、有序集合或哈希表类型的 key ,时间复杂度为O(M), M 为以上数据结构内的元素数量。

删除给定的一个或多个 key 。不存在的 key 会被忽略。

返回值

返回Integer: 被删除 key 的数量。

例子

redis> SET key1 "Hello"

  1. OK

redis> SET key2 "World"

  1. OK

redis> DEL key1 key2 key3

  1. (integer) 2
redis>

Comments powered by Disqus

This website is open source software developed by Citrusbyte.

The Redis logo was designed by Carlos Prioglio. See more credits.

Sponsored by Redis Support