FLUSHDB
FLUSHDB [ASYNC | SYNC]
- Group
- Server
- Complexity
- O(N) where N is the number of keys in the database
- Arity
- -1 (at least 1 words, counting the command name)
- Flags
- write
- HotKV Cloud
- All plans
- On-Premise
- no license needed
FLUSHDB deletes every key in the connection’s selected database, and the
tags attached to those keys. Other databases are not touched. Like any
write, it is sent to replicas and written to the append-only file. There is
no undo.
Options
Section titled “Options”| Option | Effect |
|---|---|
ASYNC |
Accepted. The keys are deleted before the reply, as with SYNC. |
SYNC |
Delete the keys before replying. |
Return value
Section titled “Return value”| Case | Reply (RESP2 and RESP3) |
|---|---|
| Flushed | Simple string OK |
| Any other argument | Error ERR syntax error |
Examples
Section titled “Examples”127.0.0.1:6379> DBSIZE(integer) 1520127.0.0.1:6379> FLUSHDBOK127.0.0.1:6379> DBSIZE(integer) 0In HotKV Cloud, the CLI tab of the panel does not run FLUSHDB. Send it
from your own client connection.
Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8, except that ASYNC does not defer freeing
memory to the background.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.