CLIENT
Manages client connection properties.
Syntax
Section titled “Syntax”CLIENT <subcommand> [arguments]Subcommands
Section titled “Subcommands”CLIENT SETINFO
Section titled “CLIENT SETINFO”Sets client library metadata on the current connection.
CLIENT SETINFO <attribute> <value>| Parameter | Type | Required | Description |
|---|---|---|---|
attribute | string | Yes | Attribute name: lib-name or lib-ver |
value | string | Yes | Attribute value |
CLIENT SETNAME
Section titled “CLIENT SETNAME”Sets a human-readable name for the current connection.
CLIENT SETNAME <name>| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Connection name |
Return Value
Section titled “Return Value”All subcommands return simple string OK on success.
Behavior
Section titled “Behavior”CLIENT SETINFO stores library metadata (lib-name or lib-ver) on the connection. CLIENT SETNAME sets the
connection name. Both values live as long as the connection does, so SESSION.CLOSE keeps them.
This command does not require the cluster to be initialized.
Errors
Section titled “Errors”Argument errors:
| Error Code | Error message | Cause |
|---|---|---|
ERR | wrong number of arguments for 'CLIENT|<subcommand>' command | - |
ERR | Unrecognized option '<attribute>' | The SETINFO attribute is not lib-name or lib-ver. |
ERR | unknown subcommand: '<value>' | - |
Examples
Section titled “Examples”Set library name:
127.0.0.1:5484> CLIENT SETINFO lib-name jedisOKSet library version:
127.0.0.1:5484> CLIENT SETINFO lib-ver 4.3.1OKSet connection name:
127.0.0.1:5484> CLIENT SETNAME my-app-connectionOK