BLESS GET
BLESS GET key
- Available since:
- Redis Open Source 8.12.0
- Time complexity:
- O(1).
- ACL categories:
-
@keyspace,@fast, - Compatibility:
- Redis Software and Redis Cloud compatibility
BLESS GET returns the eviction-protection flags currently set on a key. The key must already exist.
Required arguments
key
The name of the key to inspect. The key must already exist, or the command returns an error.
Details
BLESS GET returns an empty array if the key exists but has no protection flags. NO-EVICT is currently the only flag BLESS defines.
Examples
redis> SET session:42 "some value" OK redis> BLESS GET session:42 (empty array) redis> BLESS SET session:42 NO-EVICT (integer) 1 redis> BLESS GET session:42 1) "NO-EVICT" redis> BLESS GET missing-key (error) ERR no such key
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ❌ Standard |
❌ Standard |
Return information
One of the following:
- Array reply of the key's active protection flags, empty if none are set.
- Simple error reply if the key doesn't exist.
See also
BLESS SET | BLESS CLEAR | BLESS SCAN