LMOVE to atomically take an element from one end of a list and push it onto one end of another list, returning the element.
The two directions are chosen independently: LEFT RIGHT takes from the head of the source and appends to the tail of the destination, which preserves order when transferring between queues, while LEFT LEFT behaves like moving between stacks. If the source is empty nothing happens and the reply is null. Source and destination may be the same key, in which case the list is rotated.
Because the element is never outside a list, LMOVE is the building block for reliable queues: a worker moves an item into a processing list, does the work, and removes it from there, so a crash leaves the item recoverable instead of lost. It replaces the deprecated RPOPLPUSH, and BLMOVE is the blocking form.
Syntax
Arguments
Response
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples
TCP examples use the TLSREDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
Redis CLI
@upstash/redis
@upstash/redis
upstash_redis
upstash_redis
ioredis
ioredis
node-redis
node-redis
redis-py
redis-py
go-redis
go-redis
jedis
jedis
redis-rs
redis-rs