SISMEMBER
AttentionThis page documents an earlier version. Go to the latest (v2.1)version.
Synopsis
SISMEMBER key member_value
This command is a predicate for whether or not a value is a member of a set that is associated with the given key
.
- If the
key
is associated with a value that is not a set, an error is raised. - If the
key
does not exist, its associated set is empty, and the command returns 0. - If the
member
belongs to the given set, an integer of 1 is returned.
Return Value
Returns 1 if the specified member exists. Returns 0 otherwise.
Examples
You can do this as shown below.
$ SADD yuga_world "America"
1
$ SISMEMBER yuga_world "America"
1
$ SISMEMBER yuga_world "Moon"
0
See Also
当前内容版权归 YugabyteDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 YugabyteDB .