Complete the code to set a key to expire after 60 seconds.
EXPIRE mykey [1]The EXPIRE command sets the time-to-live in seconds. Here, 60 means the key expires after 60 seconds.
Complete the code to check the remaining time to live of a key.
TTL [1]The TTL command returns the remaining time to live of the key 'mykey'.
Fix the error in the command to set expiration to 120 seconds.
EXPIRE mykey [1]The EXPIRE command requires the time in seconds as a number. '120' is correct. Strings like 'two_minutes' or '1m' are invalid. Negative numbers are invalid.
Fill both blanks to set a key to expire and then check its TTL.
EXPIRE [1] 30 TTL [2]
We set expiration on the key 'cache' and then check TTL on the same key 'cache'.
Fill all three blanks to set a key expiration, check TTL, and remove expiration.
EXPIRE [1] 45 TTL [2] PERSIST [3]
We set expiration on 'tempkey', check its TTL, then remove expiration with PERSIST on the same key 'tempkey'.