I want to delete all keys. I want everything wiped out and give me a blank database.
Is there a way to do this in Redis client?
If you are using Java then from the documentation, you can use any one of them based on your use case.
/**
* Remove all keys from all databases.
*
* @return String simple-string-reply
*/
String flushall();
/**
* Remove all keys asynchronously from all databases.
*
* @return String simple-string-reply
*/
String flushallAsync();
/**
* Remove all keys from the current database.
*
* @return String simple-string-reply
*/
String flushdb();
/**
* Remove all keys asynchronously from the current database.
*
* @return String simple-string-reply
*/
String flushdbAsync();
Code:
RedisAdvancedClusterCommands syncCommands = // get sync() or async() commands
syncCommands.flushdb();
Read more: https://github.com/lettuce-io/lettuce-core/wiki/Redis-Cluster