Complete the code to set a key with an expiration time in Redis.
SET mykey myvalue EX [1]The EX option sets the expiration time in seconds. Here, 60 means the key expires after 60 seconds.
Complete the code to retrieve the value of a key in Redis.
[1] mykeyThe GET command retrieves the value stored at the specified key.
Fix the error in the code to publish a message to a Redis channel.
PUBLISH [1] "Hello World"
The PUBLISH command sends a message to a channel. The channel name should be a string like mychannel.
Fill both blanks to create a Redis hash and set a field value.
HSET [1] [2] "John"
HSET sets a field in a hash. The first blank is the hash key, like user:1000. The second blank is the field name, like name.
Fill all three blanks to subscribe to a Redis channel and receive messages.
SUBSCRIBE [1] [2] [3]
The SUBSCRIBE command listens to one or more channels. Here, the blanks are channel names like news, updates, and alerts.