zadd
Add members to a Redis sorted set with assigned scores and optional expiration times. Enables efficient storage, retrieval, and management of ordered data structures in Redis.
Instructions
Add a member to a Redis sorted set with an optional expiration time.
Args: key (str): The sorted set key. score (float): The score of the member. member (str): The member to add. expiration (int, optional): Expiration time in seconds.
Returns: str: Confirmation message or an error message.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
expiration | No | ||
key | Yes | ||
member | Yes | ||
score | Yes |
Input Schema (JSON Schema)
{
"properties": {
"expiration": {
"default": null,
"title": "Expiration",
"type": "integer"
},
"key": {
"title": "Key",
"type": "string"
},
"member": {
"title": "Member",
"type": "string"
},
"score": {
"title": "Score",
"type": "number"
}
},
"required": [
"key",
"score",
"member"
],
"title": "zaddArguments",
"type": "object"
}