Skip to main content

Arguments

key
string
required
The key to of the stream.
id
string | *
required
The stream entry ID. If * is passed, a new ID will be generated automatically.
entries
Record<string, unknown>
required
Key-value data to be appended to the stream.
options
object

Response

The ID of the newly added entry.
const result = await redis.xadd("mystream", "*", { name: "John Doe", age: 30 });
I