generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 94
feat: add new commands to redis js and py docs #613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alitariksahin
wants to merge
4
commits into
main
Choose a base branch
from
DX-2353
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| --- | ||
| title: CLIENT SETINFO | ||
| description: Set client library name and version information. | ||
| --- | ||
|
|
||
| The `CLIENT SETINFO` command sets client library name and version information that will be shown in CLIENT LIST and CLIENT INFO commands. This helps identify which client library is being used and is useful for debugging and monitoring. | ||
|
|
||
| ## Arguments | ||
|
|
||
| <ParamField body="attribute" type="Literal['LIB-NAME', 'LIB-VER']" required> | ||
| The attribute to set (case-insensitive): | ||
| - `"LIB-NAME"` or `"lib-name"`: Library name | ||
| - `"LIB-VER"` or `"lib-ver"`: Library version | ||
| </ParamField> | ||
|
|
||
| <ParamField body="value" type="str" required> | ||
| The value to set for the attribute. | ||
| </ParamField> | ||
|
|
||
| ## Response | ||
|
|
||
| <ResponseField type="str" required> | ||
| Returns `"OK"` if the attribute was successfully set. | ||
| </ResponseField> | ||
|
|
||
| <RequestExample> | ||
| ```py Set Library Name | ||
| # Set the library name | ||
| result = redis.client_setinfo("LIB-NAME", "redis-py") | ||
| assert result == "OK" | ||
| ``` | ||
|
|
||
| ```py Set Library Version | ||
| # Set the library version | ||
| result = redis.client_setinfo("LIB-VER", "1.0.0") | ||
| assert result == "OK" | ||
| ``` | ||
|
|
||
| ```py Lowercase Attributes | ||
| # Attributes are case-insensitive | ||
| redis.client_setinfo("lib-name", "redis-py") | ||
| redis.client_setinfo("lib-ver", "2.0.0") | ||
| ``` | ||
|
|
||
| ```py With Custom Suffix | ||
| # Common pattern: include wrapper or framework info | ||
| redis.client_setinfo("LIB-NAME", "redis-py(upstash_v1.0.0)") | ||
| redis.client_setinfo("LIB-VER", "1.0.0") | ||
| ``` | ||
|
|
||
| ```py Complete Setup | ||
| # Set both library name and version | ||
| redis.client_setinfo("LIB-NAME", "my-redis-wrapper") | ||
| redis.client_setinfo("LIB-VER", "3.2.1") | ||
|
|
||
| # Now this information will appear in CLIENT LIST output | ||
| ``` | ||
| </RequestExample> | ||
|
|
||
| ## Use Cases | ||
|
|
||
| - **Debugging**: Identify which client library version is being used | ||
| - **Monitoring**: Track different client libraries connecting to Redis | ||
| - **Analytics**: Understand client library distribution across connections | ||
| - **Support**: Quickly identify client versions when troubleshooting issues | ||
|
|
||
| ## Viewing Client Information | ||
|
|
||
| After setting client info, you can view it using the CLIENT LIST command: | ||
|
|
||
| ```py | ||
| # Set client information | ||
| redis.client_setinfo("LIB-NAME", "redis-py") | ||
| redis.client_setinfo("LIB-VER", "1.0.0") | ||
|
|
||
| # View all clients (if you have access to CLIENT LIST) | ||
| # The output will include lib-name and lib-ver fields | ||
| ``` | ||
|
|
||
| ## Best Practices | ||
|
|
||
| 1. **Set on Connection**: Set client info immediately after establishing a connection | ||
| 2. **Include Version**: Always set both library name and version | ||
| 3. **Use Descriptive Names**: Make library names easily identifiable | ||
| 4. **Version Format**: Use semantic versioning (e.g., "1.2.3") | ||
| 5. **Include Context**: Add wrapper or framework info if applicable | ||
|
|
||
| <Note> | ||
| This command is available in Redis 7.2.0 and later. The attribute names are case-insensitive and will be normalized to uppercase. | ||
| </Note> | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.