SMEMBERS
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
SMEMBERS key
This command selects all members of the set that is associated with the given key.
- If
keyis associated with a value that is not a set, an error is raised. - If
keydoes not exist, no value is returned.
Return value
Returns all members of the given set.
Examples
$ SADD yuga_world "Africa"
1
$ SADD yuga_world "America"
1
$ SMEMBERS yuga_world
1) "Africa"
2) "America"