0
0
Redisquery~10 mins

XADD for adding entries 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 add an entry to a Redis stream with the ID generated automatically.

Redis
XADD mystream [1] name Alice age 30
Drag options to blanks, or click blank then click option'
A0
B+
C$
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or $ instead of * causes errors or unexpected behavior.
Forgetting to specify the ID placeholder.
2fill in blank
medium

Complete the code to add an entry with a specific ID '1609459200000-0' to the stream.

Redis
XADD mystream [1] name Bob score 85
Drag options to blanks, or click blank then click option'
A*
B1609459200000-0
C$
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using * when a specific ID is required.
Using $ which refers to the last ID in the stream.
3fill in blank
hard

Fix the error in the code to add an entry with fields 'temperature' and 'humidity'.

Redis
XADD weather_stream [1] temperature 22 humidity 60
Drag options to blanks, or click blank then click option'
Alast
Blatest
C*
Dnow
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like 'latest' or 'now' instead of *.
Omitting the ID placeholder.
4fill in blank
hard

Fill both blanks to add an entry with ID '1609459200000-0' and fields 'event' and 'status'.

Redis
XADD events_stream [1] event login status [2]
Drag options to blanks, or click blank then click option'
A1609459200000-0
B*
Cstatus
Dsuccess
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping field names and values.
Using * instead of the explicit ID.
5fill in blank
hard

Fill all three blanks to add an entry with automatic ID and fields 'user', 'action', and 'time'.

Redis
XADD user_actions [1] user Alice action [2] [3] 10:00
Drag options to blanks, or click blank then click option'
A*
Baction
Ctime
Dlogin
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up field names and values.
Using explicit ID instead of *.