EXEC · Valkey

EXEC

Executes all commands in a transaction if conditions match.

Usage

EXEC [<IFEQ key value | IFNE key value | NX nonexisting-key | XX existing-key>…]

Description

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

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

Reply RESP2

One of the following:

Reply RESP3

One of the following:

Complexity

O(N) for N conditions, plus the complexity of commands in the transaction

ACL Categories

@slow @transaction

History

See also

DISCARD, MULTI, UNWATCH, WATCH.