# FUNCTION FLUSH

> Delete all function libraries.

URL: https://docs.hotkv.com/commands/function-flush/

```
FUNCTION FLUSH [ASYNC | SYNC]
```

- Group: Scripting and functions
- Complexity: O(N) where N is the number of functions
- HotKV Cloud: all plans
- On-Premise: no license needed

`FUNCTION FLUSH` deletes every loaded library and function. The change is
persisted and replicated. The script cache used by [EVAL](https://docs.hotkv.com/commands/eval/index.md) is
not affected (see [SCRIPT FLUSH](https://docs.hotkv.com/commands/script-flush/index.md)). `ASYNC` and `SYNC`
are accepted for compatibility; the libraries are deleted before the reply in
both cases.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Simple string `OK` | Simple string `OK` |

Any argument other than `ASYNC` or `SYNC` replies with
`ERR FUNCTION FLUSH only supports SYNC|ASYNC option`.

## Examples

```
127.0.0.1:6379> FUNCTION FLUSH
OK
127.0.0.1:6379> FCALL echo 0 "hi"
(error) ERR Function not found
```

## Compatibility

Same replies as Redis 7 and Valkey 8.

## See also

[FUNCTION DELETE](https://docs.hotkv.com/commands/function-delete/index.md), [SCRIPT FLUSH](https://docs.hotkv.com/commands/script-flush/index.md),
[FUNCTION RESTORE](https://docs.hotkv.com/commands/function-restore/index.md)