RANDOMKEY

Returns a randomly selected key from the database.

Keys & expiration · Example verified

Syntax covered here

RANDOMKEY

The case contains one key, so it verifies key selection without assessing randomness across multiple keys.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> SET sample value
"OK"
# connection: default
> RANDOMKEY
"sample"