Skip to main content

EXEC

Syntax​

EXEC

Time complexity: Depends on commands in the transaction

ACL categories: @slow, @transaction

Executes all previously queued commands in a transaction and restores the connection state to normal.

If a command is rejected while queuing (for example, an unknown command or a wrong number of arguments), EXEC discards the transaction without executing any queued command and returns an EXECABORT error. The error from a nested MULTI call does not abort the transaction.

When using WATCH, EXEC will execute commands only if the watched keys were not modified, allowing for a check-and-set mechanism.

Return​

Array reply: each element being the reply to each of the commands in the atomic transaction.

When using WATCH, EXEC can return a Null reply if the execution was aborted.