xadd
Adds an entry to a Redis stream with customizable fields and an optional expiration time, returning the entry ID upon success. Ideal for managing data streams efficiently.
Instructions
Add an entry to a Redis stream with an optional expiration time.
Args: key (str): The stream key. fields (dict): The fields and values for the stream entry. expiration (int, optional): Expiration time in seconds.
Returns: str: The ID of the added entry or an error message.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
expiration | No | ||
fields | Yes | ||
key | Yes |