0
0
Redisquery~10 mins

HSET and HGET for fields 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 set the field 'name' to 'Alice' in the hash 'user:1'.

Redis
HSET user:1 [1] Alice
Drag options to blanks, or click blank then click option'
Auser
Bvalue
Cfield
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using the hash key instead of the field name.
Confusing the field with the value.
2fill in blank
medium

Complete the code to get the value of the field 'email' from the hash 'user:2'.

Redis
HGET user:2 [1]
Drag options to blanks, or click blank then click option'
Aemail
Buser
Cname
Daddress
Attempts:
3 left
💡 Hint
Common Mistakes
Using the hash key instead of the field name.
Using a field name that does not exist.
3fill in blank
hard

Fix the error in the command to set the field 'age' to 30 in the hash 'user:3'.

Redis
HSET [1] age 30
Drag options to blanks, or click blank then click option'
Auser3
Buser:3
Cuser_3
Duser-3
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores or dashes instead of colons in the key.
Misspelling the key name.
4fill in blank
hard

Fill both blanks to set the field 'city' to 'Paris' in the hash 'location:1'.

Redis
HSET [1] [2] Paris
Drag options to blanks, or click blank then click option'
Alocation:1
Buser:1
Ccity
Dcountry
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the hash key and field name.
Using the wrong hash key.
5fill in blank
hard

Fill both blanks to get the value of the field 'phone' from the hash 'contact:5'.

Redis
HGET [1] [2]
Drag options to blanks, or click blank then click option'
Acontact:5
Bphone
Cemail
Daddress
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong hash key.
Using a wrong field name.