0
0
Redisquery~10 mins

RENAME and RENAMENX in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to rename a key unconditionally in Redis.

Redis
RENAME [1] newkey
Drag options to blanks, or click blank then click option'
Anewkey
Brename
Coldkey
Dkey
Attempts:
3 left
💡 Hint
Common Mistakes
Using the new key name as the first argument instead of the old key name.
Confusing the command with RENAMENX.
2fill in blank
medium

Complete the code to rename a key only if the new key does not exist.

Redis
RENAMENX [1] newkey
Drag options to blanks, or click blank then click option'
Anewkey
Boldkey
Ckey
Drename
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the old and new key names.
Using RENAME instead of RENAMENX when conditional rename is needed.
3fill in blank
hard

Fix the error in the command to rename a key only if the new key does not exist.

Redis
RENAMENX oldkey [1]
Drag options to blanks, or click blank then click option'
Aoldkey
Bkey
Crename
Dnewkey
Attempts:
3 left
💡 Hint
Common Mistakes
Using the old key name as the new key name.
Using the command name as an argument.
4fill in blank
hard

Fill both blanks to rename a key unconditionally from 'session1' to 'session2'.

Redis
RENAME [1] [2]
Drag options to blanks, or click blank then click option'
Asession1
Bsession2
Cuser1
Duser2
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the old and new key names.
Using keys that do not exist.
5fill in blank
hard

Fill all three blanks to rename a key only if the new key does not exist, from 'temp' to 'perm'.

Redis
RENAMENX [1] [2] # returns [3] if successful
Drag options to blanks, or click blank then click option'
Atemp
Bperm
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong return value for success.
Swapping old and new key names.