0
0
Redisquery~10 mins

HMSET and HMGET for bulk 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 multiple fields in a Redis hash using HMSET.

Redis
HMSET user:1000 [1]
Drag options to blanks, or click blank then click option'
A"name" "Alice"
B"name" "Alice" "age" "30"
C"user" "1000"
D"age" "30"
Attempts:
3 left
💡 Hint
Common Mistakes
Providing only one field-value pair when multiple are needed.
Using incorrect syntax without quotes around strings.
2fill in blank
medium

Complete the code to retrieve multiple fields from a Redis hash using HMGET.

Redis
HMGET user:1000 [1]
Drag options to blanks, or click blank then click option'
A"email"
B"user" "1000"
C"name"
D"name" "age"
Attempts:
3 left
💡 Hint
Common Mistakes
Requesting only one field when multiple are needed.
Using the key as a field name.
3fill in blank
hard

Fix the error in the HMSET command to correctly set multiple fields.

Redis
HMSET user:1000 [1]
Drag options to blanks, or click blank then click option'
A"name" "Alice" "age" "30"
Bname Alice age 30
C"name" "Alice" age 30
Dname, Alice, age, 30
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas between fields and values.
Not quoting string values.
4fill in blank
hard

Fill both blanks to set and then get multiple fields in Redis.

Redis
HMSET user:2000 [1]
HMGET user:2000 [2]
Drag options to blanks, or click blank then click option'
A"city" "Paris" "country" "France"
B"city" "country"
C"Paris" "France"
D"country" "city"
Attempts:
3 left
💡 Hint
Common Mistakes
Using values instead of field names in HMGET.
Mixing order of fields and values.
5fill in blank
hard

Fill all three blanks to set multiple fields, then retrieve them in Redis.

Redis
HMSET user:3000 [1]
HMGET user:3000 [2]
HMGET user:3000 [3]
Drag options to blanks, or click blank then click option'
A"first_name" "John" "last_name" "Doe"
B"first_name" "last_name"
C"John" "Doe"
D"age" "email"
Attempts:
3 left
💡 Hint
Common Mistakes
Using values instead of field names in HMGET.