0
0
Redisquery~10 mins

EXISTS to check key existence 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 check if the key 'user:1' exists in Redis.

Redis
EXISTS [1]
Drag options to blanks, or click blank then click option'
Auser1
B"user:1"
Cuser:1
D'user:1'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around the key name.
Using an incorrect key name.
2fill in blank
medium

Complete the code to check if the key stored in variable 'keyName' exists.

Redis
EXISTS [1]
Drag options to blanks, or click blank then click option'
Akeyname
BkeyName
C"keyName"
D'keyName'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around the variable name.
Using a different variable name.
3fill in blank
hard

Fix the error in the code to correctly check if the key 'session:123' exists.

Redis
EXISTS [1]
Drag options to blanks, or click blank then click option'
A'session:123'
B"session:123"
Csession123
Dsession:123
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around the key name.
Using an incorrect key name without colon.
4fill in blank
hard

Fill both blanks to check if the keys 'user:1' and 'user:2' exist in one command.

Redis
EXISTS [1] [2]
Drag options to blanks, or click blank then click option'
A'user:1'
B'user:2'
Cuser:1
Duser:2
Attempts:
3 left
💡 Hint
Common Mistakes
Quoting the keys.
Using variable names instead of key names.
5fill in blank
hard

Fill all three blanks to check if keys stored in variables 'key1', 'key2', and 'key3' exist.

Redis
EXISTS [1] [2] [3]
Drag options to blanks, or click blank then click option'
Akey1
Bkey2
Ckey3
D'key3'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around variable names.
Using string literals instead of variables.