English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis Multi command is used to mark the start of a transaction block.
Multiple commands within a transaction block are enqueued in a queue in the order of execution, and finally executed atomically by the EXEC command.
The basic syntax of the Redis Multi command is as follows:
redis 127.0.0.1:6379> Multi
>= 1.2.0
Always returns OK .
redis 127.0.0.1:6379> MULTI # Mark the start of a transaction OK redis 127.0.0.1:6379> INCR user_id # Multiple commands enqueued in order QUEUED redis 127.0.0.1:6379> INCR user_id QUEUED redis 127.0.0.1:6379> INCR user_id QUEUED redis 127.0.0.1:6379> PING QUEUED redis 127.0.0.1:6379> EXEC # Execute 1) (integer) 1 2) (integer) 2 3) (integer) 3 4) PONG