What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

CLIENT GETNAME

Returns the name of the connection.

Usage
CLIENT GETNAME
Complexity
O(1)
Since
2.6.9
ACL Categories
@connection, @slow
Command flags
ALLOW_BUSY, NOSCRIPT, LOADING, STALE, SENTINEL

The CLIENT GETNAME returns the name of the current connection as set by CLIENT SETNAME. Since every new connection starts without an associated name, if no name was assigned a null bulk reply is returned.

Replies

RESP2

One of the following:

RESP3

One of the following: