Complete the code to set a key-value pair in Redis.
SET [1] "Hello"
The SET command stores a value under a key. Here, the key should be a name like greeting.
Complete the code to retrieve the value of a key in Redis.
GET [1]The GET command retrieves the value stored under the given key. Here, the key is greeting.
Fix the error in the code to delete a key in Redis.
DEL [1]The DEL command deletes the key and its value. You must specify the key name, here greeting.
Fill both blanks to set a key with an expiration time in seconds.
SET [1] "SessionData" [2] 300
PX instead of EX for seconds.The SET command can take EX to set expiration time in seconds. The key name here is session_key.
Fill all three blanks to add a member with a score to a sorted set in Redis.
ZADD [1] [2] [3]
The ZADD command adds a member with a score to a sorted set. Here, leaderboard is the set name, 1500 is the score, and player1 is the member.