Set
SMOVE
Move a member from one set to another
await redis.sadd("original", "a", "b", "c");
const moved = await redis.smove("original", "destination", "a");
// moved: 1
// original: ["b", "c"]
// destination: ["a"]
Arguments
source
string
requiredThe key of the set to move the member from.
destination
string
requiredThe key of the set to move the member to.
member
TMember
The members to move
Response
1
if the member was moved, 0
if not.
Was this page helpful?
await redis.sadd("original", "a", "b", "c");
const moved = await redis.smove("original", "destination", "a");
// moved: 1
// original: ["b", "c"]
// destination: ["a"]