Complete the code to add a member to a Redis set named 'fruits'.
SADD fruits [1]The SADD command adds the specified member to the set stored at key. Here, 'banana' is added to the 'fruits' set.
Complete the code to remove a member from the Redis set 'fruits'.
SREM fruits [1]SADD instead of SREM to remove members.The SREM command removes the specified member from the set stored at key. Here, 'banana' is removed from the 'fruits' set.
Fix the error in the command to add 'orange' to the 'fruits' set.
SADD [1] orangeThe set name must be exactly 'fruits' to add the member correctly. Using a different name will create or modify a different set.
Fill both blanks to add 'kiwi' and then remove 'apple' from the 'fruits' set.
SADD fruits [1] SREM fruits [2]
First, SADD fruits kiwi adds 'kiwi' to the set. Then, SREM fruits apple removes 'apple' from the set.
Fill all three blanks to add 'grape', remove 'melon', and add 'pear' to the 'fruits' set.
SADD fruits [1] SREM fruits [2] SADD fruits [3]
SREM to add members or SADD to remove.The commands add 'grape', remove 'melon', and add 'pear' to the 'fruits' set in order.