0
0
Redisquery~10 mins

HLEN for field count 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 get the number of fields in the hash stored at key 'user:1000'.

Redis
HLEN [1]
Drag options to blanks, or click blank then click option'
Auser:1000
Bhash:user:1000
Cuser1000
Dfields:user1000
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong key name that does not exist.
Confusing the key with a field name.
2fill in blank
medium

Complete the code to count fields in the hash stored at key 'session:abc123'.

Redis
HLEN [1]
Drag options to blanks, or click blank then click option'
Aabc123:session
Bsession_abc123
Csession:abc123
Dsession:123abc
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping parts of the key name.
Using underscores instead of colons.
3fill in blank
hard

Fix the error in the command to get the field count of hash 'config:settings'.

Redis
HLEN [1]
Drag options to blanks, or click blank then click option'
Aconfig_settings
Bconfig:settings
Csettings:config
Dconfigsettings
Attempts:
3 left
💡 Hint
Common Mistakes
Replacing colons with underscores.
Mixing up the order of words in the key.
4fill in blank
hard

Fill both blanks to count fields in the hash with key 'profile:john_doe' using the Redis CLI.

Redis
[1] [2]
Drag options to blanks, or click blank then click option'
AHLEN
BHGETALL
Cprofile:john_doe
Duser:john_doe
Attempts:
3 left
💡 Hint
Common Mistakes
Using HGETALL instead of HLEN.
Using the wrong key name.
5fill in blank
hard

Fill the blanks to write pseudo-code that counts fields in the hash 'settings:app' and stores the result in variable 'fieldCount'.

Redis
fieldCount = [1] [2]
Drag options to blanks, or click blank then click option'
AHLEN
Bsettings:app
CGET
DHGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using HGET or GET instead of HLEN.
Mixing up the order of command and key.