0
0
Redisquery~10 mins

XLEN for stream length 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 length of a Redis stream named 'mystream'.

Redis
XLEN [1]
Drag options to blanks, or click blank then click option'
Amystream
Bmylist
Cmyhash
Dmyset
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-stream key like a list or hash name.
Forgetting to provide the stream name after XLEN.
2fill in blank
medium

Complete the code to get the length of a Redis stream stored in the variable 'stream_key'.

Redis
XLEN [1]
Drag options to blanks, or click blank then click option'
Astream_key
B'stream_key'
CstreamKey
DSTREAM_KEY
Attempts:
3 left
💡 Hint
Common Mistakes
Adding quotes around the variable name, making it a string literal.
Using uppercase or camelCase when the variable is lowercase.
3fill in blank
hard

Fix the error in the command to get the length of the stream 'events'.

Redis
XLEN [1]
Drag options to blanks, or click blank then click option'
Aevents_stream
Bevents
C'events'
Devent
Attempts:
3 left
💡 Hint
Common Mistakes
Adding quotes around the stream name.
Using a wrong or incomplete stream name.
4fill in blank
hard

Fill both blanks to get the length of the stream stored in variable 'streamName' and store it in variable 'length'.

Redis
length = [1] [2]
Drag options to blanks, or click blank then click option'
AXLEN
BstreamName
Cmystream
DGET
Attempts:
3 left
💡 Hint
Common Mistakes
Using GET instead of XLEN.
Using a hardcoded stream name instead of the variable.
5fill in blank
hard

Fill all three blanks to get the length of the stream 'orders', check if it is greater than 100, and store the result in 'isLarge'.

Redis
length = [1] [2]
isLarge = length [3] 100
Drag options to blanks, or click blank then click option'
AXLEN
Borders
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comparison operator.
Using a wrong stream name.