(nil) if the key does not exist or has expired.
Syntax
Parameters
The name of the key to look up.
Return value
Returns the stored string value, or(nil) if the key is missing or has expired.
Errors
| Condition | Error message |
|---|---|
| Wrong number of arguments | (error) wrong number of arguments for 'GET' |
Examples
Notes
GET implements passive expiry. If the key exists in memory but its TTL has elapsed, the key is deleted inline and (nil) is returned — no explicit sweep is required.GET never updates a key’s TTL. Use SET with EX to reset expiry.