Set

SMOVE

Move a member from one set to another

Arguments

sourcebodystrrequired

The key of the set to move the member from.

destinationbodystrrequired

The key of the set to move the member to.

memberbodystr

The members to move

Response

boolrequired

True if the member was moved, False if it was not.

Example
redis.sadd("src", "one", "two", "three")redis.sadd("dest", "four")assert redis.smove("src", "dest", "three") == Trueassert redis.smembers("source") == {"one", "two"}assert redis.smembers("destination") == {"three", "four"}
Loading search…