List

LMOVE

Move an element from one list to another.

Arguments

sourcebodystrrequired

The key of the source list.

destinationbodystrrequired

The key of the destination list.

wherefrombody"left" | "right"required

The side of the source list from which the element was popped.

wheretobody"left" | "right"required

The side of the destination list to which the element was pushed.

Response

strrequired

The element that was moved.

Example
redis.rpush("source", "one", "two", "three")redis.lpush("destination", "four", "five", "six")assert redis.lmove("source", "destination", "RIGHT", "LEFT") == "three"assert redis.lrange("source", 0, -1) == ["one", "two"]
Loading search…