Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

FLUSHDB

Last updated
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.

Option Effect
ASYNC Accepted. The keys are deleted before the reply, as with SYNC.
SYNC Delete the keys before replying.
Case Reply (RESP2 and RESP3)
Flushed Simple string OK
Any other argument Error ERR syntax error
127.0.0.1:6379> DBSIZE
(integer) 1520
127.0.0.1:6379> FLUSHDB
OK
127.0.0.1:6379> DBSIZE
(integer) 0

In HotKV Cloud, the CLI tab of the panel does not run FLUSHDB. Send it from your own client connection.

Same as Redis 7 and Valkey 8, except that ASYNC does not defer freeing memory to the background.

FLUSHALL, DEL, SELECT, DBSIZE