Hint: Multiple subscriptions need multiple UNSUBSCRIBE calls [OK]
Common Mistakes:
Assuming one UNSUBSCRIBE removes all duplicates
Thinking UNSUBSCRIBE syntax is wrong
Believing Redis lacks UNSUBSCRIBE support
5. A client subscribed to channels news, sports, and weather. It wants to stop receiving messages only from news and weather but keep sports. Which command should it use?
hard
A. UNSUBSCRIBE news weather
B. UNSUBSCRIBE sports
C. UNSUBSCRIBE
D. UNSUBSCRIBE all
Solution
Step 1: Identify channels to unsubscribe
The client wants to stop messages from 'news' and 'weather' only.
Step 2: Use UNSUBSCRIBE with specific channels
UNSUBSCRIBE followed by channel names unsubscribes only those channels, keeping others subscribed.
Final Answer:
UNSUBSCRIBE news weather -> Option A
Quick Check:
UNSUBSCRIBE with channels removes only those [OK]
Hint: List channels in UNSUBSCRIBE to remove only those [OK]
Common Mistakes:
Using UNSUBSCRIBE with no args removes all
Trying UNSUBSCRIBE all which is invalid
Unsubscribing wrong channels
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.