SISMEMBER
This page documents the preview (v2.21) version. Preview includes features under active development and is for development and testing only. For production, use the stable (v2024.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
keyis associated with a value that is not a set, an error is raised. - If the
keydoes not exist, its associated set is empty, and the command returns 0. - If the
memberbelongs to the given set, an integer of 1 is returned.
Return Value
Returns 1 if the specified member exists. Returns 0 otherwise.
Examples
$ SADD yuga_world "America"
1
$ SISMEMBER yuga_world "America"
1
$ SISMEMBER yuga_world "Moon"
0