Complete the code to rename a key unconditionally in Redis.
RENAME [1] newkeyThe RENAME command renames the key oldkey to newkey unconditionally.
Complete the code to rename a key only if the new key does not exist.
RENAMENX [1] newkeyThe RENAMENX command renames oldkey to newkey only if newkey does not already exist.
Fix the error in the command to rename a key only if the new key does not exist.
RENAMENX oldkey [1]The second argument must be the new key name. Here, newkey is correct.
Fill both blanks to rename a key unconditionally from 'session1' to 'session2'.
RENAME [1] [2]
This command renames the key session1 to session2 unconditionally.
Fill all three blanks to rename a key only if the new key does not exist, from 'temp' to 'perm'.
RENAMENX [1] [2] # returns [3] if successful
The command renames temp to perm only if perm does not exist. It returns 1 on success.