RANDOMKEY
Syntax
RANDOMKEY
- Available since:
- Redis Open Source 1.0.0
- Time complexity:
- O(1)
- ACL categories:
-
@keyspace,@read,@slow, - Compatibility:
- Redis Enterprise and Redis Cloud compatibility
Return a random key from the currently selected database.
Redis Enterprise and Redis Cloud compatibility
| Redis Enterprise |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
One of the following:
- Nil reply: when the database is empty.
- Bulk string reply: a random key in database.