Introduction
XADD lets you add new messages to a Redis stream, which is like a list that keeps data in order.
XADD stream_name [MAXLEN ~ max_length] * field1 value1 [field2 value2 ...]
XADD mystream * temperature 22 humidity 60
XADD mystream MAXLEN ~ 1000 * event login user aliceXADD mystream * message "Hello, world!"XADD orders * product_id 123 quantity 2 XADD orders * product_id 456 quantity 1 XRANGE orders - +
XADD do?name and age to a Redis stream mystream using XADD?XADD mystream MAXLEN 2 * temperature 22 humidity 60 executed three times in a row, how many entries will mystream contain afterwards?XADD mystream MAXLEN 5 name John agesensor_data but keep only the latest 100 entries to save memory. Which command correctly adds a new entry with fields temp and humidity and enforces this limit?Pass the test and this pattern moves unknown