Easy Tutorial
❮ Sets Sinter Redis Intro ❯

Redis Flushdb Command

Redis Server

The Redis Flushdb command is used to clear all keys in the current database.

Syntax

The basic syntax for the redis Flushdb command is as follows:

redis 127.0.0.1:6379> FLUSHDB

Available Versions

= 1.0.0

Return Value

Always returns OK.

Example

redis 127.0.0.1:6379> DBSIZE    # Number of keys before flush
(integer) 4

redis 127.0.0.1:6379> FLUSHDB
OK

redis 127.0.0.1:6379> DBSIZE    # Number of keys after flush
(integer) 0

Redis Server

❮ Sets Sinter Redis Intro ❯