SREM
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
SREM key value [value …]
This command removes one or more specified members from the set that is associated with the given key
.
- If the
key
does not exist, the associated set is an empty set, and the return value is zero. - If the
key
is associated with a value that is not a set, an error is raised. - If a specified
value
does not exist in the given set, thatvalue
is ignored and not counted toward the total of removed members.
Return Value
Returns the total number of existed members that were removed from the set.
Examples
You can do this as shown below.
$ SADD yuga_world "America"
1
$ SADD yuga_world "Moon"
1
$ SREM yuga_world "Moon"
1
$ SREM yuga_world "Moon"
0
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .