0
0
Redisquery~10 mins

Hash vs string for objects in Redis - Interactive Practice

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

Complete the code to set a string value for a key in Redis.

Redis
SET user:1000 [1]
Drag options to blanks, or click blank then click option'
A1000
BJohn
Cuser
D"John"
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting string values causes errors.
Using a key name as the value.
2fill in blank
medium

Complete the code to set a field in a Redis hash.

Redis
HSET user:1000 [1] "John"
Drag options to blanks, or click blank then click option'
Aname
Buser
C1000
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key name as the field.
Confusing field and value.
3fill in blank
hard

Fix the error in the command to get a field from a Redis hash.

Redis
HGET user:1000 [1]
Drag options to blanks, or click blank then click option'
A1000
Bname
Cuser
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key name instead of the field.
Using the value instead of the field.
4fill in blank
hard

Fill both blanks to set multiple fields in a Redis hash.

Redis
HMSET user:1000 [1] [2]
Drag options to blanks, or click blank then click option'
A"name" "John"
B"age" "30"
C"user" "1000"
D"value" "data"
Attempts:
3 left
💡 Hint
Common Mistakes
Using key names instead of field-value pairs.
Not pairing fields with values.
5fill in blank
hard

Fill all three blanks to retrieve multiple fields from a Redis hash.

Redis
HMGET user:1000 [1] [2] [3]
Drag options to blanks, or click blank then click option'
Aname
Bage
Cemail
Duser
Attempts:
3 left
💡 Hint
Common Mistakes
Using the key name as a field.
Not listing multiple fields.