Recall & Review
beginner
What does the Redis command
SMEMBERS do?The
SMEMBERS command returns all the members of a set stored at a given key in Redis.Click to reveal answer
beginner
How do you use
SMEMBERS to get all elements of a set named fruits?You run
SMEMBERS fruits. This command lists all members inside the fruits set.Click to reveal answer
beginner
Can
SMEMBERS return duplicate elements?No, sets in Redis do not allow duplicates, so
SMEMBERS returns unique members only.Click to reveal answer
beginner
What type of data structure must the key hold to use
SMEMBERS?The key must hold a set data structure in Redis to use
SMEMBERS.Click to reveal answer
beginner
If the key does not exist, what does
SMEMBERS return?SMEMBERS returns an empty array if the key does not exist.Click to reveal answer
What does the Redis command
SMEMBERS myset return?✗ Incorrect
SMEMBERS returns all members of the set stored at the specified key.If the key does not exist, what will
SMEMBERS return?✗ Incorrect
SMEMBERS returns an empty list if the key does not exist.Which Redis data type is required to use
SMEMBERS?✗ Incorrect
SMEMBERS works only on sets.Can
SMEMBERS return duplicate values?✗ Incorrect
Sets in Redis store unique values, so
SMEMBERS returns unique members only.Which command would you use to get all members of a set named 'colors'?
✗ Incorrect
SMEMBERS colors lists all members of the set 'colors'.Explain what the Redis command
SMEMBERS does and when you would use it.Think about how you get all items from a collection that stores unique values.
You got /4 concepts.
Describe the difference between
SMEMBERS and commands that return single or count values from a set.Compare what each command returns about the set.
You got /4 concepts.