I want to be able to delete all the keys. Is there a way to flush all in node redis?
Redis client:
client = redis.createClient(REDIS_PORT, REDIS_HOST);
Starting from Redis 4.0.0 or greater, you can now delete all keys asynchronously using FLUSHALL [ASYNC]
. Using the client, just pass the 'ASYNC'
option to the command like so:
client.flushall('ASYNC', callback);
Use FLUSHDB [ASYNC]
to flush keys from a selected database. Use FLUSHALL [ASYNC]
to flush keys from all databases.