FLUSHDB
The FLUSHDB command is used to clear all keys in the currently selected Redis database.
Redis Native Command Syntax
Section titled “Redis Native Command Syntax”FLUSHDBParameter Description
The FLUSHDB command takes no parameters.
Detailed Explanation
Section titled “Detailed Explanation”The FLUSHDB command deletes all keys in the currently selected database, but does not affect other databases. This is a very powerful command and should be used with caution.
Redisun Usage
Section titled “Redisun Usage”In redisun, the FLUSHDB command is implemented through the FlushDbCommand class and the flushDb method in the Redisun class.
Basic Usage
Section titled “Basic Usage”Redisun redisun = Redisun.create(options -> {  options.setAddress("redis://127.0.0.1:6379");});
// Clear the current databaseboolean result = redisun.flushDb();System.out.println("FlushDB result: " + result);- FLUSHDB only affects the currently selected database
- This is a dangerous operation that deletes all data in the database
- The command returns true when executed successfully