Recall & Review
beginner
What does the Redis command
SUNIONSTORE do?It creates a new set by combining all unique members from given sets and stores the result in a specified destination key.
Click to reveal answer
beginner
How do you use
SUNIONSTORE to combine sets set1 and set2 into resultSet?Use the command:
SUNIONSTORE resultSet 2 set1 set2. This stores the union of set1 and set2 in resultSet.Click to reveal answer
intermediate
What happens if the destination key in
SUNIONSTORE already exists?The existing key is overwritten with the new union set.
Click to reveal answer
beginner
Can
SUNIONSTORE be used with just one set?Yes, but it simply copies that set to the destination key.
Click to reveal answer
beginner
What type of data structure does
SUNIONSTORE work with in Redis?It works only with sets, which are collections of unique strings.
Click to reveal answer
What does
SUNIONSTORE dest set1 set2 do?✗ Incorrect
SUNIONSTORE combines all unique members from the given sets and stores them in the destination key.
If
dest already exists, what happens when you run SUNIONSTORE dest set1 set2?✗ Incorrect
The existing dest key is overwritten with the new union set.
Which Redis data type is required for
SUNIONSTORE?✗ Incorrect
SUNIONSTORE works only with sets.
What result does
SUNIONSTORE dest set1 produce?✗ Incorrect
Using one set copies it to the destination key.
Which command would you use to combine multiple sets and save the result in Redis?
✗ Incorrect
SUNIONSTORE combines sets and stores the union.
Explain how the Redis command SUNIONSTORE works and when you would use it.
Think about combining unique items from different groups and saving them.
You got /4 concepts.
Describe what happens if the destination key already exists when using SUNIONSTORE.
Consider how Redis handles keys when storing new data.
You got /3 concepts.