FLUSHALL

Since 1.1.0ServerChanged in 1.2.1

Syntax

FLUSHALL
  • Flags: write
  • ACL categories: @dangerous, @slow, @write
  • Arity: -1

History

  • 1.2.1: acl categories: removed server

Deletes every key of every database, then replies. It cannot be undone, and it is a write like any other: replicas delete their keys too, and the next snapshot or AOF rewrite has none.

  • SYNC frees the memory before replying.
  • ASYNC replies at once and frees large values on a background thread, as described in Memory.
  • Without either, it frees at once, as with SYNC. lazyfree-lazy-user-flush is accepted and changes nothing.

Anything but ASYNC or SYNC is refused with ERR syntax error, as in Redis, since 1.2.1. 1.2.0 took any other word as SYNC, and flushed. FLUSHDB deletes the keys of one database.

Reply

OK.

Examples

> MSET a 1 b 2 c 3
OK
> DBSIZE
(integer) 3
> FLUSHALL SYNC
OK
> DBSIZE
(integer) 0