0
0
Redisquery~10 mins

Hash slots distribution in Redis - Interactive Code Practice

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

Complete the command to get the hash slot for a key.

Redis
CLUSTER KEYSLOT [1]
Drag options to blanks, or click blank then click option'
A1000
Buser:1000
C"user:1000"
DKEYSLOT
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around the key name causes an error.
Using a number instead of the key name.
2fill in blank
medium

Complete the command to get all keys in a specific hash slot.

Redis
CLUSTER GETKEYSINSLOT [1] 5
Drag options to blanks, or click blank then click option'
A0
B5000
C1000
Dslot
Attempts:
3 left
💡 Hint
Common Mistakes
Using a key name instead of a slot number.
Using a slot number outside the valid range.
3fill in blank
hard

Fix the error in the command to get the hash slot for a key.

Redis
CLUSTER KEYSLOT [1]
Drag options to blanks, or click blank then click option'
Auser:123
BKEYSLOT
C123
D"user:123"
Attempts:
3 left
💡 Hint
Common Mistakes
Including quotes around the key name.
Using a number instead of the key name.
4fill in blank
hard

Fill both blanks to get keys from slot 1000 with a count of 3.

Redis
CLUSTER GETKEYSINSLOT [1] [2]
Drag options to blanks, or click blank then click option'
A1000
B3
C5
Dslot
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the slot number and count.
Using invalid slot numbers or counts.
5fill in blank
hard

Fill all three blanks to get the hash slot for key 'session:42' and then get 2 keys from that slot.

Redis
SET key session:42
SLOT = CLUSTER KEYSLOT [1]
CLUSTER GETKEYSINSLOT [2] [3]
Drag options to blanks, or click blank then click option'
Asession:42
BSLOT
C2
Dsession42
Attempts:
3 left
💡 Hint
Common Mistakes
Using an incorrect key name.
Using a literal slot number instead of the variable.
Using wrong count number.