Atomically pop an element from a source list and push it to a destination list
Pops an element from the source list (from LEFT or RIGHT) and pushes it to the destination list (to LEFT or RIGHT).
method
Atomically pop an element from a source list and push it to a destination list
Pops an element from the source list (from LEFT or RIGHT) and pushes it to the destination list (to LEFT or RIGHT).
The source list key
The destination list key
Direction to pop from source: "LEFT" (head) or "RIGHT" (tail)
Direction to push to destination: "LEFT" (head) or "RIGHT" (tail)
Promise that resolves with the element moved, or null if the source list is empty
await redis.lpush("source", "a", "b", "c");
const result1 = await redis.lmove("source", "dest", "LEFT", "RIGHT");
// result1: "c" (popped from head of source, pushed to tail of dest)
const result2 = await redis.lmove("source", "dest", "RIGHT", "LEFT");
// result2: "a" (popped from tail of source, pushed to head of dest)