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

RANDOMKEY

Returns a random key name from the database.

Usage
RANDOMKEY
Complexity
O(1)
Since
1.0.0
ACL Categories
@keyspace, @read, @slow
Command flags
READONLY, TOUCHES_ARBITRARY_KEYS

Return a random key from the currently selected database.

Replies

RESP2

One of the following:

RESP3

One of the following: